Jump to content

custom transform pieces


Recommended Posts

The first problem is that You got a mismatch between the number of highres and lowres pieces. Second You have to plug in points to the template and rest inputs.
I don't know how You are animating the pieces but maybe You have a possibility to convert that animation to points. Otherwise You would have to write some VEX or create a attribute vop to calculate the rotation of your pieces.
Hope that helps.

Dennis

Link to comment
Share on other sites

Thanks Dennis

 

I have now the same number of pieces on the highres and lowres geos, and I converted the animation and template to points with all the attributes promoted to the points and still doesnt works. I also played with up and N attributes on the points and with orient also but I only get the offset of the position without rotations :(
Any help will be much apreciated.

Link to comment
Share on other sites

I sort of got this to work, but its not pretty.

 

Transform pieces assumes you're working with packed geo right from the start. The hip file has packed highres geo, but regular lo-res geo (and regular static lo-res geo). Packing the 2 lo-res shapes won't magically know how to create @orient for your rotated pieces, all it'll do is calculate the centroid of the shifted pieces, which is what you've already seen.

 

A point deform works, but it won't be able to separate on the edges of each piece, so you'd get the high res shape deformed, but with the edges welded together. It would work if you did them one by one in a for-each loop.

 

But to get _that_ to work, you need to have matching name attributes on all 3 shapes, which is the approach I went with, and to not get confused, delete hires shapes that don't have a matching lores shape (your highres selection doesn't match the lo-res).

 

So:

 

-set 'hires', 'static', 'anim' attributes on each mesh so they can be identified later

-temporarily pack the lo-res rest mesh

-set a 'hit' attribute on it

-attrib transfer 'name' and 'hit' from lores packed static to highres packed static, with 0 falloff, so points have to be directly lined up for the transfer to happen

-blast highres packed points where hit=0

-unpack hires geo

-merge highres, lores anim, lores static. they should now have matching name attributes

 

in a for each loop, set to loop on 'name':

-isolate highres, anim, static

-feed those to point deform

 

As I said, ugly, but works.

 

You'd be better off using the transfer pieces as it was originally intended, and animate your shatter with packed geo and/or packed rbd.

 

foreach_point_deform.hipnc

 

 

Alternatively it's probably possible to create orient attribs per packed piece using the geo you have now, but that was more maths than my mind could handle at 11pm. :)

Edited by mestela
Link to comment
Share on other sites

  • 4 months later...
On 3/1/2016 at 7:15 AM, petz said:

here´s another one...

 

hth.

petz

transform_pieces1.hipnc

Great stuff guys!

Hey petz,  I was trying to write something like this for a while. Love your method. I have a question, do you think it is possiable to do the matrix transform by the macthing name attr? Instead of prim-uv?

 

Best,

Berk.

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...