Hi, i got a lot of pieces of breaking object and apply an foreach to spread them randomly, each of pieces has its own prim group. I want to edit some major pieces so i attach an ‘transform’ node (i want to do some custom position adjustment) . I apply ‘tranform for each of selected pieces i want to adjust. Probably end up with 20-30 ’transform' node to adjust some major pieces i want to control. I want to keep this ‘transform’ node ‘alive’ which means, if in case i need to go upstream and do a bit of modification where the number of point will be changed, then i don't want to redo all the edit/transform i've done.
Back to the problem, if i modified upstream and number of point is changed, all the ‘transform’ downstream will screwed up coz it's using pattern based selection. So to have this ‘transform’ keep tracking what it's been done, i need to input group name instead of range pattern. But to get the group name, i have to select from drop down list, which one is which? i have to inspect in the viewport to select the proper group.
My question is it possible to input group name without having to select from drop down list (there might be hundreds items) ? Really i mean, i want to select them interactively the group in the viewport, then get the group name displayed in the ‘group’ parameter of the ‘transform’ node. I switch selection mode to ‘primitive groups’ , it help me select group properly in the viewport, but in the ‘transform’ param , i still got range pattern.
Anyone has any good trick to solve this problem?
Thanx
select prim group interactively
13125 7 0- metaclay
- Member
- 122 posts
- Joined: 5月 2006
- Offline
- luoqiulin
- Member
- 305 posts
- Joined: 5月 2007
- Offline
sorry for my bad English, i don't know weather i understanded your question. in viewport you can select the prims you want to transform,add a “delete” node,change “delete” option to “Delete Non-selected” all primGroups you want transform is here, in textpot type:
echo `primgrouplist(“/obj/geo1/delete1”)`
that's the groups
echo `primgrouplist(“/obj/geo1/delete1”)`
that's the groups
- mrCatfish
- Member
- 732 posts
- Joined: 12月 2006
- Offline
You can select groups in the viewport this way:
Viewing your geo at SOP level, go to the toolbar to the immediate left of the viewport, (it might be hidden), and right click on the second icon down. Select “Primitive Groups” or “point groups”.
I'd forgotten about this!
Viewing your geo at SOP level, go to the toolbar to the immediate left of the viewport, (it might be hidden), and right click on the second icon down. Select “Primitive Groups” or “point groups”.
I'd forgotten about this!
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
CG Supervisor
Machine FX - Cinesite MTL
- mrCatfish
- Member
- 732 posts
- Joined: 12月 2006
- Offline
- metaclay
- Member
- 122 posts
- Joined: 5月 2006
- Offline
- metaclay
- Member
- 122 posts
- Joined: 5月 2006
- Offline
luoqiulin
sorry for my bad English, i don't know weather i understanded your question. in viewport you can select the prims you want to transform,add a “delete” node,change “delete” option to “Delete Non-selected” all primGroups you want transform is here, in textpot type:
echo `primgrouplist(“/obj/geo1/delete1”)`
that's the groups
Thanx for replying,
Nop, that's not what i want to do. Here's to simplify the case : you have 3 spheres, each of the sphere has its own group (group 1,group2,group3). Later you want to modify the position of sphere2 (group2). So you attach a transform node to do the job. In the transform node , select the group/sphere then do the transformation (important : when selecting obj try to pick up from viewport , NOT from the group list !!! ). Done and you're happy with it. Suddenly you realize that u need to update the obj on the top level, and the modification will change the number of point. If you do that, absolutely the transformation u did before will gone wild. You will break your object for sure. So updating the obj will be a very bad idea. Otherwise you have to repeat all the transform. To deal with this thing, do not select obj from viewport, but you have to pick up group name from the group list in the ‘transform’ parameter. With this method , no matter you change your object, the transform node is still working fine.
But the problem with this method is : let say you have hundreds pieces of object (like glass breaking) , where each of pieces has its own group. For sure i don't want to pick up manually selecting group from the list , scrolling down hundreds item, trying to pick up which one is the right pieces, there are gonna be something like : pieces101,pieces102….pieces340 etc to select from. In this case , it's absolutely clear that you'll love to pick up INTERACTIVELY from viewport.
thanx
- luoqiulin
- Member
- 305 posts
- Joined: 5月 2007
- Offline
hi i'm just trying to use python,maybe this shelf tool can help you,but i have not enough time to learn HOM,so wish anyone can improve it.
1. add a new tool on your shelf then past this python code in it
2. in your sop delete groups named“outside”,“inside” if there are
3. add a delete sop in your sop rename it “delete_tmp” ,set opertion= Delete Non-Selected
4.select prims you need transform then click on the newtool you has created by step 1.
so one transform node created with the primgroups you has selected,but you must link it yourself,repeat step you can add more transform node!
import toolutils
viewer = toolutils.sceneViewer()
obj_node = viewer.selectGeometry(quick_select=True)
a =obj_node.nodes()
aa=a.parent()
deltmp = aa.node(“delete_tmp”)
deltmp.setParms({“pattern”: str(obj_node)})
delgeo = deltmp.geometry()
trans1 = aa.createNode(“xform”)
trans1.setParms({“group”: str(delgeo.primGroups())})
1. add a new tool on your shelf then past this python code in it
2. in your sop delete groups named“outside”,“inside” if there are
3. add a delete sop in your sop rename it “delete_tmp” ,set opertion= Delete Non-Selected
4.select prims you need transform then click on the newtool you has created by step 1.
so one transform node created with the primgroups you has selected,but you must link it yourself,repeat step you can add more transform node!
import toolutils
viewer = toolutils.sceneViewer()
obj_node = viewer.selectGeometry(quick_select=True)
a =obj_node.nodes()
aa=a.parent()
deltmp = aa.node(“delete_tmp”)
deltmp.setParms({“pattern”: str(obj_node)})
delgeo = deltmp.geometry()
trans1 = aa.createNode(“xform”)
trans1.setParms({“group”: str(delgeo.primGroups())})
Edited by - 2011年4月21日 01:07:28
- luoqiulin
- Member
- 305 posts
- Joined: 5月 2007
- Offline
import toolutils
viewer = toolutils.sceneViewer()
obj_node = viewer.selectGeometry(quick_select=True)
a =obj_node.nodes()
aa=a.parent()
deltmp = aa.node(“delete_tmp”)
deltmp.setParms({“pattern”: str(obj_node)})
delgeo = deltmp.geometry()
trans1 = aa.createNode(“xform”)
trans1.setParms({“group”: str(delgeo.primGroups())})
trans1.setParmExpressions({“px”:“$GCX”,“py”:“$GCY”,“pz”:“$GCZ”})
trans1.setInput(0,aa.displayNode())
trans1.setDisplayFlag(1)
trans1.setSelected(1)
trans1.setRenderFlag(1)
this is better now, select one or more prims ,click on the newtool press EnterKey to transform,that's all(the delete_tmp node is need too).
-
- Quick Links