Jump to content

How to match point positions between 2 models with different number of


magneto

Recommended Posts

Hi,

Imagine having a multi part model where they are all part of the same mesh but it's not all continuous like this:

H0E1Z.png

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 by magneto
Link to comment
Share on other sites

Hi,

Imagine having a multi part model where they are all part of the same mesh but it's not all continuous like this:

H0E1Z.png

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Owl
  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ;)

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...