I have written a custom scene file exporter.
All the geometrical object can have n number of custom attributes out
of 46 attributes. When looping through all the objects in the scene I
have to use if-elif to check if attribute is present or not. If it's
present, executed the related code.
This is slow (3000 objects * 46 attributes = 138000 if-elif
conditions)
It seems python can offer something here although I am not sure.
Create a dictionary of {attribute:code_to_execute}
All the custom attributes have prefix "__amn__". I can get all the
attributes on the object start with some prefix in one go. Iterate on
attributes found and execute the code related to it.
I need some advise over here. It will be little tricky but I think
python can achieve this.
Prashant
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---