homeless3d Posted February 29, 2016 Share Posted February 29, 2016 (edited) Hi all. I'm trying to use the transform pieces sop without using a dop simulation. i'm deforming some low res geo and I want to translate their centroid animations to the hi res pieces with no luck at all. Can someone help me please? Thanks in advance. P transform_pieces.hipnc Edited February 29, 2016 by homeless3d 1 Quote Link to comment Share on other sites More sharing options...
DennisSchmidt Posted March 1, 2016 Share Posted March 1, 2016 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 Quote Link to comment Share on other sites More sharing options...
homeless3d Posted March 1, 2016 Author Share Posted March 1, 2016 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. Quote Link to comment Share on other sites More sharing options...
mestela Posted March 1, 2016 Share Posted March 1, 2016 (edited) 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 March 1, 2016 by mestela Quote Link to comment Share on other sites More sharing options...
petz Posted March 1, 2016 Share Posted March 1, 2016 here´s another one... hth. petz transform_pieces1.hipnc 3 Quote Link to comment Share on other sites More sharing options...
homeless3d Posted March 1, 2016 Author Share Posted March 1, 2016 Wow that's awesome guys! Thank you all. Quote Link to comment Share on other sites More sharing options...
berkhak Posted July 19, 2016 Share Posted July 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
petz Posted July 20, 2016 Share Posted July 20, 2016 take a look at the findattribval() function in vex. if you have matching names it returns the corresponding primitive number. hth. petz transform_pieces2.hipnc 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.