magneto Posted October 22, 2012 Share Posted October 22, 2012 (edited) Hi, Imagine having a multi part model where they are all part of the same mesh but it's not all continuous like this: You perform an operation where you have to isolate a certain piece like one of the tires, so you blast everything else. You modified the shape of the tire the way you wanted and now you want to bring it back to the original model. The point numbers are different, so how can you bring in the changes so the point numbers of the original model are not modified, but the tire has the new shape? Is the Sort SOP the only way? I thought there would be some way to read back the positions (P) from the modified tire back into the original model by using a stored point number attribute that have the same point numbers as the original tire. I tried Point SOP's match by attribute but it requires the same number of points on each input. I am pretty sure there must be a clever way to do this. Thanks Edited October 22, 2012 by magneto Quote Link to comment Share on other sites More sharing options...
ranxerox Posted October 23, 2012 Share Posted October 23, 2012 Hi, Imagine having a multi part model where they are all part of the same mesh but it's not all continuous like this: You perform an operation where you have to isolate a certain piece like one of the tires, so you blast everything else. You modified the shape of the tire the way you wanted and now you want to bring it back to the original model. The point numbers are different, so how can you bring in the changes so the point numbers of the original model are not modified, but the tire has the new shape? Is the Sort SOP the only way? I thought there would be some way to read back the positions (P) from the modified tire back into the original model by using a stored point number attribute that have the same point numbers as the original tire. I tried Point SOP's match by attribute but it requires the same number of points on each input. I am pretty sure there must be a clever way to do this. Thanks maybe instead of blast, you could group the part you want to work on and isolate it that way ? -G Quote Link to comment Share on other sites More sharing options...
magneto Posted October 23, 2012 Author Share Posted October 23, 2012 Thanks, but I can't. After blasting the point numbers that I order become an importance to use in code (0-n), instead of point numbers going all over the whole model. I sort the point numbers myself and just using groups is not possible because not every operator supports them, etc. So working on the single piece makes it very easy. Quote Link to comment Share on other sites More sharing options...
Owl Posted October 23, 2012 Share Posted October 23, 2012 (edited) Hi, Have you tried pasing original point number into "id" attrbute and then transfering position with point node ($TX2/$TY2/$TZ2) with match by attribute "id" on? edit: transferPos.hip Does this solve your problem? A bit more complicated that the first idea, but seems to get the job done. Edited October 23, 2012 by Owl 1 Quote Link to comment Share on other sites More sharing options...
michael Posted October 23, 2012 Share Posted October 23, 2012 lattice SOP in points mode should work if I'm understanding you correctly. Quote Link to comment Share on other sites More sharing options...
magneto Posted October 23, 2012 Author Share Posted October 23, 2012 Thanks guys. @Owl: That's an interesting solution. I didn't want to use AttribTransfer thinking it would be slow. I guess it might be just as fast. But sorting seems much simpler than doing this. @Michael: Would lattice not require both inputs to have the same number of points? Because the original model could have 100k points, while the tire model is only 5k for instance. Quote Link to comment Share on other sites More sharing options...
michael Posted October 23, 2012 Share Posted October 23, 2012 here is the workflow that I'd use the only tricky part is the merge - you'll need to merge stuff back in with the correct order HTH edit_part.0.hip 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted October 23, 2012 Author Share Posted October 23, 2012 Thanks Michael, I see what you mean. But if you take a part in the middle, then merging them becomes more tricky right? Especially if you have to do this procedurally. Quote Link to comment Share on other sites More sharing options...
michael Posted October 23, 2012 Share Posted October 23, 2012 true... I guess it depends on what yo're doing.... is the car what you're doing or is that just an example? Quote Link to comment Share on other sites More sharing options...
magneto Posted October 23, 2012 Author Share Posted October 23, 2012 Thanks Michael, no that was just an example I used to explain myself better If you let the user specify the piece to modify as a number i.e. whole disconnected part id, you could make it work using your technique via foreach. But if you give the users the ability to specify any group like primitives 0-100 120-150 180-220, then it would be tricky to merge them procedurally so that their point numbers stay intact. Quote Link to comment Share on other sites More sharing options...
Owl Posted October 23, 2012 Share Posted October 23, 2012 Back to original idea no attr transfer transferPos2.hip 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted October 23, 2012 Author Share Posted October 23, 2012 Thanks Owl, very nice trick. This is better than AttribTransfer because that might not be very exact if the model has very tiny details and have to come up with a good radius. I didn't realize you could ignore the Point SOP's warning and fix it afterwards. That's really good. I wish the Point SOP didn't change the points it couldn't match though. That would be even better, I will use your trick Quote Link to comment Share on other sites More sharing options...
edward Posted October 24, 2012 Share Posted October 24, 2012 Seems to work for me if I just give an appropriate group for the Point SOP to Match By id (despite the warning). transferPosMatchById.hipnc 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted October 24, 2012 Author Share Posted October 24, 2012 Thanks Edward, that's even better Quote Link to comment Share on other sites More sharing options...
Owl Posted October 25, 2012 Share Posted October 25, 2012 But it gets slow with heavy meshes, here is another version: transferPosMatchById.hip 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted October 25, 2012 Author Share Posted October 25, 2012 Thanks Owl, is this method faster than other 2 using the Point SOP's match by id, even though this also uses it? Quote Link to comment Share on other sites More sharing options...
Owl Posted October 25, 2012 Share Posted October 25, 2012 its faster that Edward's, and should be faster than mine (haven't checked thou) 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted October 25, 2012 Author Share Posted October 25, 2012 Awesome, I just didn't add up all the numbers to see which one was faster, was just assuming based on the number of nodes Or are you using the performance monitor? I should use that tool more often. It's just that if you have an asset and it has a bunch of nodes inside, middle clicking on the asset doesn't show the actual time it took to cook all the nodes inside. Quote Link to comment Share on other sites More sharing options...
Owl Posted October 26, 2012 Share Posted October 26, 2012 ok so we have 3 methods: 1 - save original pos, move all points(match by id), group match ones that are in 0,0,0, move them back to original pos 2 - introduce edit attribute "edit", make a "dinamic group"(?) based on it, match by id, move only those points 3 - create group with python expression on original points by matching "id", transfer pos to only those points results: 1- while fast its sort of risky coz you could have a point(s) that is originally @0,0,0 and was edited, and it makes group with expression 2- makes group dynamically, moves only necessary points, no need to store original pos 3- python expressions for groups are slooow eval time of 100 animated frames(for pos transfer only): 1- 9.447s 2- 9.518s 3- 22min 6.56s i would go with v2 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted October 26, 2012 Author Share Posted October 26, 2012 Thanks man, this is very helpful 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.