UuosKovacevic Posted November 26, 2017 Share Posted November 26, 2017 Hi, I have a problem with randomizing Object ID, because I use to work with groups in 3dsMax. When I try to randomize Object IDs with ID Tool script it doesn't see group as one object, but also randomize objects inside the group, so in the end I have too many Object IDs in scene and I need to make so much Render Elements for post production. Does anyone know any script that randomize Object IDs and also can see a group as one object in randomization? Thanks, Link to comment Share on other sites More sharing options...
jackbird Posted November 27, 2017 Share Posted November 27, 2017 This should work for most cases. Select the objects you want to assign random object IDs to and run the script. It will fail if the objects in your groups have children of their own; let me know if this is the case. You can adjust the number at the beginning of the script to set how many random object IDs it uses. numObjectIDs = 10 --change this number to set maximum random object ID objectScope = selection as array myGroups = for obj in objectScope where ((superclassof obj ==helpers) and (isGroupHead obj)) collect obj mySingletons = for obj in objectScope where (((superclassof obj == geometryClass) or (superclassof obj == shape)) and (not isGroupMember obj)) collect obj for obj in mySingletons do obj.gbufferchannel = (random 1 numObjectIDs) for obj in myGroups do ( groupID = random 1 numObjectIDs obj.gbufferChannel = groupID for subObj in obj.children do subObj.gbufferchannel = groupID ) Link to comment Share on other sites More sharing options...
UuosKovacevic Posted November 28, 2017 Author Share Posted November 28, 2017 Thanks Jon, but there's still a problem... this script randomize IDs but still leaves Groups with ObjID 0 (and also polys inside the group) Link to comment Share on other sites More sharing options...
jackbird Posted December 4, 2017 Share Posted December 4, 2017 I didn't see that in testing. Can you post a scene? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now