Get point positions for array (ordered)

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Get point positions for array (ordered)

Post by Pancho » 12 Jun 2011, 22:08

I'm currently digging into Pooby's face rigging, but in ICE as I need to transform the envelop nulls in other manners too.

So I do have my face deformer mesh and a null for each point on this null.

I use a "Get closest point" node, feed it into a "Get Point Position" node and each null's ICE node picks up the point positions from an array of the ICE tree. Voila! It works. The nulls will place themselves at each vertex on the face deformer mesh.

The problem starts when I moce the points. As the distance to the position in the "Get closest point" node changes, so does the point order. The null on the mesh start to exchange their positions. The whole face is messed up.

How do I get the point positions of the mesh in a consitent order?

I don't know how? If there is a way to get also a point ID array and sort the point position array and the point ID array it could work. But I wouldn't know how to sort two array in the same manner. But for sure there is an easier way.

Cheers!

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 16:43

Re: Get point positions for array (ordered)

Post by Chris_TC » 12 Jun 2011, 23:24

I can't try it right now, but here's my theory:
From the get closest points you get the pointID. Then you use a Sort Array to make sure this list is always sorted.

To get the point positions, you use a <<Find in Array>> and connect its boolean output to a <<Filter>>
<<self.PointID>> goes into Value of <<Find in Array>>
<<your sorted array>> goes into Array of <<Find in Array>
<<self.PointPosition>> goes into the <<Filter>>

The result of the filter should be a sorted list of point positions.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Get point positions for array (ordered)

Post by Pancho » 13 Jun 2011, 10:04

Sounds nice! But how do I get the IDs from the "closest point" node? It doesn't output the ID and whatever I connect to "Get .ID" or "Get Point ID" will turn red. I guess this context stuff is just killing my brain (per point/per object).

I just want a consitent list of point positions which I can feed into an array which then gets set so all the null can retrieve their own positions.
You do not have the required permissions to view the files attached to this post.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Get point positions for array (ordered)

Post by Pancho » 13 Jun 2011, 10:05

P.S.: The get ID node turns red as soon as I connect it too the set data node.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Get point positions for array (ordered)

Post by Pancho » 13 Jun 2011, 11:35

The "Build Array From Per Point Data" saved my butt. Just needed to get rid of the "Get Self" node. Somehow it didn't let my object data get through it. Wonder why there is a "Name In" input if the "Self" stuff overrides it. But never mind.

But thanks for the other tip!

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 16:43

Re: Get point positions for array (ordered)

Post by Chris_TC » 13 Jun 2011, 14:17

Pancho wrote:Sounds nice! But how do I get the IDs from the "closest point" node?
I overlooked that you are working with geometry. ID values are only for pointclouds as far as I know. In the case of geometry you should use VertexIndex.
Sounds like you have already solved it, but for what it's worth, here's the tree I had tried to describe.

Image

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 16:43

Re: Get point positions for array (ordered)

Post by Chris_TC » 13 Jun 2011, 14:27

The tree is simpler if you don't need to convert the per-point data into object data:

Image

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Get point positions for array (ordered)

Post by Pancho » 14 Jun 2011, 10:52

Thanks so much for posting.

Here's my ICE tree. The matrix (array) then gets set on the ICE tree, from which the nulls will retrieve their SRTs.
You do not have the required permissions to view the files attached to this post.