Jump to content
Sign in to follow this  
anicg

possible? maintain original scale and orientation upon instancing

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×