Scale Object Instances To Match Scale of Prims?

   1495   3   1
User Avatar
Member
8 posts
Joined: May 2018
Offline
Hi Everyone,

I have a cube with different sized faces - some are thinner, some are more square for example.

I have set it up so that there is a point at the center of each prim.

I am them Instancing a new cube to sit on each of these points.

What I want to do is to make the instance cubes match the scale of the prim that they are sitting on.

Is this possible?

I am aware that the instances inherit the attributes from the points that they are instanced too but I don't fully understand how to implement it…

I have tried it with a for each loop before and got it working but it doesn't work with Instances.

Thank you for any help

I have attached some example images and my scene.
Edited by JackEaves - July 7, 2018 10:40:20

Attachments:
Instance_Scale_Test.hipnc (96.1 KB)
Example1.JPG (134.1 KB)
Example2.jpg (128.0 KB)

User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
That could be easily set up; But you haven't said what you want to use for the scale value, i.e.,

You're using the prim faces of the source box rectangle for the points to be copied on;

And in your example you either have squares or rectangles.

So what do you want to use?:

The shortest length sides, the diagonal distance, etc.

Once you've decided then simply apply that value per prim with the setpointattrib like you did with normals, except use pscale.
User Avatar
Member
8 posts
Joined: May 2018
Offline
Hi BabaJ :-)


Ideally i would like the box to match the length and width of the source prim face, Its height can stay the same. So that it matches the face perfectly.

This should work on both the squares and the rectangles because its using length and width per prim?

I hope that makes sense.

Wouldn't the pscale scale it uniformly though? Instead of on the width and length.


Thank you!
Edited by JackEaves - July 7, 2018 16:44:24
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Well I think one could do some copystamping…but I haven't used stamps in a while and forget the ins and outs of them.

I could show you something using vex…but you might not like that.

But if all you want is the width and length to be the same then the simplest thing to do is just a polyextrude in a For-Each Primiteve sop node pair.
Edited by BabaJ - July 7, 2018 18:51:56

Attachments:
Instance_Scale_Test.hipnc (92.0 KB)

  • Quick Links