Element length problem

Hi All,

I'm trying to write a maximum element filename. I'm really struggling with the greater than. I'm sure its something simple I'm missing. Anyone got any ideas?

r = maxOps.GetCurRenderElementMgr()
r.GetRenderElement 1
elementlength = r.GetRenderElementFilename 1
print elementlength.count
 
if elementlength as integer > 256 then (
	print "fred"
)
else
(
	print "geon"
)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

With this code you can print name and filename of all render elenents

re = maxOps.getCurRenderElementMgr()
reCount = re.numRenderElements()
getElement = re.getRenderElement
getFilename = re.getRenderElementFilename
reData = for e = 0 to reCount-1 do
(
	format "RE_NAME: %  -> RE_PATH: %\n" ((getElement e).elementName) (getFilename e)
)

Now to collect all elements where filename length is greater then 256 chars then use this.

re = maxOps.getCurRenderElementMgr()
reCount = re.numRenderElements()
getElement = re.getRenderElement
getFilename = re.getRenderElementFilename
reData = for e = 0 to reCount-1 where (path = getFilename e).count > 256 collect
(
	#( (getElement e), (getElement e).elementName, path)
 
)

bga

johncrawshaw's picture

Perfect!! That's not exactly

Perfect!! That's not exactly how I was thinking of fixing that problem but it works really well. Thank-you for your help. It for deadline rendering. We are having a problem with file paths over 256 characters.

Thanks, Again!

barigazy's picture

...

Can you explain a bit more or show some screehots.
I not understand what do tou mean by "maximum element filename"?

bga

johncrawshaw's picture

Attachement

Not a problem. I've attached an image with the filepath I'm looking at counting and seeing if it is over 256 characters.

renderelements

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.