Kakushi_52
Hi, I am a beginner of SOuP. I tried some nodes but I couldn't do what I want to do.

I would like to extract x, y, or z arrays to a new array.
I mean, for example, 

x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, x5, y5, z5,...

to

x1, x2, x3, x4, x5,...

The reason why I would like to do this is the following.

There is a rather big simulation data and there is a mesh. Every vertex of the mesh has various values like Energy, Force, Pressure and so on, in every frame.

Time 1
Vertex Number, Energy, Force, Pressure,...
                v1,    e1t1,    f1t1,      p1t1,....
                v2,    e2t1,    f2t1,      p2t1,....
                v3,    e3t1,    f3t1,      p3t1,....
                v4,    e4t1,    f4t1,      p4t1,....

Time 2
Vertex Number, Energy, Force, Pressure,...
                v1,    e1t2,    f1t2,      p1t2,....
                v2,    e2t2,    f2t2,      p2t2,....
                v3,    e3t2,    f3t2,      p3t2,....
                v4,    e4t2,    f4t2,      p4t2,....

, for example.

Maya's keyframing is very slow and heary, so I made a mesh data which has Energy, Force and Pressure in translateX, translateY, translateZ. And I made the geometry cache.

So, now each vertex of the mesh has the sequence of Energy, Force, Pressure in each vertex's world position.

I think I can extract an array of each vertex's world position, using pointsOnMeshInfo (Is this right?) like the following.

Time 1
e1t1, f1t1, p1t1, e2t1, f2t1, p2t1, e3t1, f3t1, p3t1, e4t1, f4t1, p4t1,... 

Time 2
e1t2, f1t2, p1t2, e2t2, f2t2, p2t2, e3t2, f3t2, p3t2, e4t2, f4t2, p4t2,... 

Now what I want to do is extract values of the array and make new arrays like
Time 1
e1t1, e2t1, e3t1, e4t1....
f1t1, f2t1, f3t1, f4t1....
p1t1, p2t1, p3t1, p4t1....

Time 2
e1t2, e2t2, e3t2, e4t2....
f1t2, f2t2, f3t2, f4t2....
p1t2, p2t2, p3t2, p4t2....

If I can make them, I think I can connect each array to Array Mapper node, and can generate colors using Ramp that is connected to the Array Mapper, and I think I can connect the result to mentalrayVertexColors node, so I can make the vertex color animation without using any keyframe!
(...Hopefully, I don't know the structure of mentalrayVertexColors.cpvSets though...)


By the way I'm using Maya 2011 Subscription Advantage Pack 64-bit. I installed SOuP but nothing happens whenver I click the nodes icon of the SOuP shelf. I can make some SOuP nodes using createNode in script editor but I can't make some SOuP nodes. Is this because I'm using old version of Maya? 

Many Thanks.
Reply 0 0
noizfactory
The 2011 version is really old now. Is there any way you can check your setup with a newer build? arrayToArray should be working in your case.
Reply 0 0
Kakushi_52
Thank you for your reply.
My OS is Vista but now I'm thinking of upgrading to Windows 7 and buy a new version of Maya...

I tried arrayToarray but I couldn't know if the connection got correct because I couldn't connect outColorPP of Array Mapper to Mental Ray Vertex Color Node...

I drew a scheme of what I'd like to do. Is there any method with Maya and SOuP??

I am sorry for bothering you...

Thank you.

VertexColors.jpg  
Reply 0 0
pshipkov
Let's take this one step back. I have the feeling that you are going in direction that may be more work than needed.
Let's take a look at the original data you have.
Best case scenario will be if you can provide us a scene with some very light geometry - maybe mesh shape with couple of points and the appropriate data attached to them. We understand that this might be a problem or too much work, etc. If that's the case then can you describe the original data structure. Maybe we can read and map data directly from there. I am not completely sure about some things.

I think you have vector array with each element of it mapped to point of the mesh.
You want to compose 3 new scalar arrays that represent the X Y Z components of the vectors in the original array ?
Is that correct ?
Reply 0 0
Kakushi_52
I am very sorry for the late reply...

Yes, one of the things I want to do is split the original array to 3 new scalar arrays.

I have attached a very simple scene composed of just two polygon pyramids.

What I tried to do is...
1. to get the scalar array of the polygon's vertex world positions of X coordinate.
    (pPyramidShape -> geoConnector1, geoConnector1.componentPositions[0] -> arrayToarray1)
2. to colorize each vertex color using arrayMapper1.
    (X coordiante value to RGB color)
3. and to make a new polygon mesh which has vertex colors according to the original polygon's X coordinate.

The script editor says,
// Warning: arrayToPointColor1: inRgbaPP array length does not match the point count. // 
So I thought I had to insert a node between arrayMapper1 and arrayToPointColor1 which makes RGBA array from RGB array so I tried using an arrayToarray node but the problem still remains.

If this runs correctly, the new mesh's vertex color changes whenever the original mesh is moved, rotated or scaled.

Thank you very much.
 


vertexcolorconnection.jpg 
Reply 0 0
Kakushi_52
I did it!!!

Now the mesh vertex colors changes according to the original mesh's X coordinate of each vertex! Plus, I can change color realtime by manipulating one single ramp node!!

Thank you SOuP, thank you noizfactory, and thank you pshipkov!!

vertexcolorconnection02.jpg 

[video]http://www.youtube.com/watch?v=57luaCSHJLA[/video]
Reply 0 0
pshipkov
Nice. Thanks for the examples.
I somehow missed your "success" post and was about to start replying to you (i know too little too late at this point).
Glad to see you figured it out.
Reply 0 0
Kakushi_52
Thank you very much for your reply, pshipkov.
SOuP really works great on my current project!!
If there was not SOuP, it would be a nightmare...

Can I ask another question?

I would like to know about remapArray node.
What does Remap Min mean??

I think Remap Max means multiplication, but I'm confusing about Remap Min.
The new array values = (The old array values + Shift Value) * (Ramap Max - Remap Min) ??

Thank you very much!
Reply 0 0
pshipkov
Glad to hear you find SOuP useful.

About your question:
It does "fit".
Your input array has the next elements 0 5 10. If you set the remap min/max to 0 and 0.1 the output array will be 0 0.5 1
If you set min/max to -0.5 1 the output array will be 0 2.5 5
if min/max are 0, 10 the output will be 0, 50, 100
Experiment a bit to get better sense of what is going on.
Reply 0 0
Reply