Jump to content

possible? maintain original scale and orientation upon instancing


anicg

Recommended Posts

I attach the hipfile.

Here is what I've done: starting from an exact orientation for each shape (only 2), I turned each into a point and tried to render as instances instead of having the duplicate geometry, but I loose the orientation when I instance to the points. I do not want to have random orientation. It MUST be the exact same place, the exact same scape, the exact same orientation as the original.

Is it possible?

instance.hiplc

lost orientation and scale.png

together.png

Link to comment
Share on other sites

Instancing looks for attributes on those points, otherwise it doesn't know how Pos Rot Scale should look like. You can go very different ways about this. The easiest is to probably save your transforms as a transform attribute and set all transforms on your points to zero. See attached scene. I marked the changed nodes yellow.

image.thumb.png.16d7c47f4c596776309d40f81cd2422a.png

image.thumb.png.393c24202cbe6d24d2194c8ebb949da4.png

instance_yader.hiplc

Link to comment
Share on other sites

10 hours ago, Yader said:

Instancing looks for attributes on those points, otherwise it doesn't know how Pos Rot Scale should look like. You can go very different ways about this. The easiest is to probably save your transforms as a transform attribute and set all transforms on your points to zero. See attached scene. I marked the changed nodes yellow

Thank you. I've tried to use "Each Connected Piece"  instead of chasing each piece separately with transform and attribute promote, but it doesn't seem to work.

I get a file imported that has a lot more pieces as input, without their individual transform nodes, too many to work on each manually. Any advise?

Edited by anicg
Link to comment
Share on other sites

I attach a new hip file to show the problem.

[instance_v2.hiplc] is the original but with file nodes which matches the kind of imported input.
[instance_v2 method not working.hiplc] is where I apply the method you've given with a for each connected piece, but but it doesn't work.

There are usually a lot more individual pieces than 3 or 4. These are only for demonstration purposes, easily hundreds per combo in reality.

instance_v2.hiplc

combo1.bgeo.sc

combo2.bgeo.sc

shape2.bgeo.sc

shape1.bgeo.sc

instance_v2 method not working.hiplc

Edited by anicg
Link to comment
Share on other sites

You can use the Extract Transform Sop for that. It just needs the objects once with transforms applied
and once without any transforms and calculates a proper transform attribute for each of them useable while instancing.

You can either use the foreach approach or copy your reference object as much as you have target geometry, both methods work.

image.thumb.png.0fc46be905e02f3d35d22d5771872693.png

 

instance_v2_yader.hiplc

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