検索 - User list
Full Version: Redshift Generate Sequential Numbering for OBJ ID
Root » 3rd Party » Redshift Generate Sequential Numbering for OBJ ID
BrettAHanson
I was watching a video from Greyscalegorilla in creating Redshift custom AOVs for control in the composite. About half way through the video, he made a sequential numbering for the object IDs based on the selected objects with an expression. I was wondering how to do this same task in Houdini to create a sequential numbering to change the object IDs for the objects in Houdini. This would be nice to know since I would not have to manually set each and every object for the object ID to have a matte in Redshift.

Link to video:
Anthony Morrelle
A quick and dirty way would be to use Python to add sequential numbers to your nodes that you select.
Select what nodes you want to add the object id's to and open the python shell:
nodes = hou.selectedNodes()
for idx,item in enumerate(nodes):
    updateitem = item.parm("RS_objprop_ID").set(idx)

There is probably a better, more obvious way but this works ok.
BrettAHanson
Anthony Morrelle
nodes = hou.selectedNodes()
for idx,item in enumerate(nodes):
updateitem = item.parm(“RS_objprop_ID”).set(idx)

Thanks Anthony! This code works pretty well. I agree that there is probably a better way is doing this. But for now, this will work.

Thanks a lot!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB