+ Reply to Thread
Results 1 to 4 of 4

Thread: Randomizing Object ID

  1. #1
    Junior Member
    Join Date
    May 2010
    Location
    Yugoslavia
    Posts
    21

    Name
    Uros Kovacevic
    Forum Username
    UuosKovacevic

    Yugoslavia

    Question Randomizing Object ID

    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,

  2. #2
    Member
    Join Date
    Nov 2004
    Posts
    91

    Name
    Jon Seagull
    Forum Username
    jackbird

    United States

    Default Re: Randomizing Object ID

    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.

    Code:
    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
    )

  3. #3
    Junior Member
    Join Date
    May 2010
    Location
    Yugoslavia
    Posts
    21

    Name
    Uros Kovacevic
    Forum Username
    UuosKovacevic

    Yugoslavia

    Default Re: Randomizing Object ID

    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)

  4. #4
    Member
    Join Date
    Nov 2004
    Posts
    91

    Name
    Jon Seagull
    Forum Username
    jackbird

    United States

    Default Re: Randomizing Object ID

    I didn't see that in testing. Can you post a scene?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 2
    Last Post: July 14th, 2015, 02:50 AM
  2. Replies: 5
    Last Post: May 11th, 2014, 11:03 AM
  3. Replies: 6
    Last Post: March 28th, 2014, 08:26 AM
  4. Plugin for randomizing textures?
    By scostumatu in forum V-Ray
    Replies: 4
    Last Post: September 8th, 2012, 02:02 AM
  5. copying object refferencing a line object
    By Bugga_Guy in forum 3ds Max
    Replies: 4
    Last Post: April 6th, 2005, 12:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts