Notifications
Clear all
[Closed] Verify Property Exists
Oct 11, 2010 8:09 pm
Is there a way to verify that a property exists on an object?
Specifically i am parsing all the objects in a scene and applying a position to them, the issue is that when i try to run that on a biped object it does not have a ‘bip01.pos’ value.
is there a way to check if that property exists?
2 Replies
Oct 11, 2010 8:09 pm
See if this helps: hasProperty obj “pos”
From Maxscript help:
The hasProperty() function allows you to test whether an object has a specified property name. Unlike isProperty(), the property name string supports wildcard patterns.
hasProperty <obj> <prop_name_or_pattern_string>
Returns true if the object has the given property or has properties matching the string pattern.
FOR EXAMPLE:
hasProperty $Box01 "height" --test for height in a Box
true
hasProperty $Box01 "radius" --test for radius in a Box
false
hasProperty $Sphere01 "radius" --test for radius in a Sphere
true
hasProperty $Sphere01 "rad*" --test for any property name
true --starting with "rad" in a Sphere
Oct 11, 2010 8:09 pm
that doesnt seem to work, its always seems to be returning false.
i can run getProperty on the object though and it returns the value. For some reason it doesnt show up in hasProperty though.
ah ha! isProperty will work, thanks!