Mozzarino Posted September 26, 2019 Share Posted September 26, 2019 (edited) After setting up the rotations for packed objects in point vops (after scattering), I just couldn't do the same for scaling and translating. I want to find a solution for cases where the scattering has already been done (or there are many instances of the same object). Can some one help me out? Bellow is the hip file. packed_objects_debug.hip Edited September 26, 2019 by diogomgf Quote Link to comment Share on other sites More sharing options...
LucaScheller Posted September 26, 2019 Share Posted September 26, 2019 (edited) Hi Diogo, To apply scale/rotate/translate after instancing you have to first undo the transform(transform in this case is actually only the scale/rotation matrix). Then you can apply your custom transform(scale/rotation matrix) to the now identity matrix (You could actually use an identity matrix here instead of applying the inverse to the incoming matrix, it's just visually more easy to understand). After that you have to reapply/restore your original transform by multiplying your custom transform with the original transform. This should do for scale and rotation. For translate you can do hacky pivot workarounds. I went a different direction and just pushed the P attribute along the different rotation axes. I've made the changes to your file. Let me know if you have further questions. I can also recommend looking at the MOPs Toolset (https://www.motionoperators.com/) to understand what's going on, as quite a few nodes manipulate packed transforms. All the best, Luca packed_objects_debug.hip Edited September 26, 2019 by LucaScheller 1 Quote Link to comment Share on other sites More sharing options...
Mozzarino Posted September 26, 2019 Author Share Posted September 26, 2019 47 minutes ago, LucaScheller said: Hi Diogo, To apply scale/rotate/translate after instancing you have to first undo the transform(transform in this case is actually only the scale/rotation matrix). Then you can apply your custom transform(scale/rotation matrix) to the now identity matrix (You could actually use an identity matrix here instead of applying the inverse to the incoming matrix, it's just visually more easy to understand). After that you have to reapply/restore your original transform by multiplying your custom transform with the original transform. This should do for scale and rotation. For translate you can do hacky pivot workarounds. I went a different direction and just pushed the P attribute along the different rotation axes. I've made the changes to your file. Let me know if you have further questions. I can also recommend looking at the MOPs Toolset (https://www.motionoperators.com/) to understand what's going on, as quite a few nodes manipulate packed transforms. All the best, Luca Thanks alot, this solved it! Cheers, Diogo Quote Link to comment Share on other sites More sharing options...
Mozzarino Posted September 26, 2019 Author Share Posted September 26, 2019 @LucaScheller Is there any good method to change the pivot for the makexform? Quote Link to comment Share on other sites More sharing options...
LucaScheller Posted September 27, 2019 Share Posted September 27, 2019 I would stick to manipulating the actual pivot beforehand (like you already had in your file), since changing the pivot in the makexform only manipulates the center of the makexform and not the actual packed pivot, which results in confusing results. Quote 1 Quote Link to comment Share on other sites More sharing options...
Mozzarino Posted September 27, 2019 Author Share Posted September 27, 2019 (edited) 1 hour ago, LucaScheller said: I would stick to manipulating the actual pivot beforehand (like you already had in your file), since changing the pivot in the makexform only manipulates the center of the makexform and not the actual packed pivot, which results in confusing results. Ok, will do it that way then. Though when I change the pivot with this method I get changes in the position of the prims even without changing the @P attr. Edited September 27, 2019 by diogomgf 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.