davidyannick Posted September 14, 2022 Share Posted September 14, 2022 Hi Is there a way in Python for instance to make relative path the default option when I use object merge instead of absolute path ? Thanks Quote Link to comment Share on other sites More sharing options...
Benyee Posted September 14, 2022 Share Posted September 14, 2022 def merge_multiple_objects(objs): obj_container=objs[0].parent().createNode('geo','merged_objs') merge_sop=obj_container.createNode('object_merge') merge_sop.parm('numobj').set(len(objs)) for i in range(len(objs)): relPath = merge_sop.relativePathTo(objs[i]) merge_sop.parm('objpath'+str(i+1)).set(relPath) merge_sop.parm('xformtype').set(1) #orgnize node positions pos=objs[-1].position() obj_container.setPosition([pos[0]+2,pos[1]-2]) sels=hou.selectedNodes() merge_multiple_objects(sels); you can try the script as a python shelf tool by selecting objects first, hope it helps Quote Link to comment Share on other sites More sharing options...
davidyannick Posted September 15, 2022 Author Share Posted September 15, 2022 On 14/09/2022 at 11:04 AM, Benyee said: def merge_multiple_objects(objs): obj_container=objs[0].parent().createNode('geo','merged_objs') merge_sop=obj_container.createNode('object_merge') merge_sop.parm('numobj').set(len(objs)) for i in range(len(objs)): relPath = merge_sop.relativePathTo(objs[i]) merge_sop.parm('objpath'+str(i+1)).set(relPath) merge_sop.parm('xformtype').set(1) #orgnize node positions pos=objs[-1].position() obj_container.setPosition([pos[0]+2,pos[1]-2]) sels=hou.selectedNodes() merge_multiple_objects(sels); you can try the script as a python shelf tool by selecting objects first, hope it helps gonna do this thanks for your hepl Quote Link to comment Share on other sites More sharing options...
Atom Posted September 15, 2022 Share Posted September 15, 2022 You can also right-click on the parameter and choose Make Current Value Default. Then, any newly created versions of that node will always be created in that state. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.