[Closed] Multidimensional array as a parameter in modifier
I made a custom modifier, and I want to store a multidimensional array in it. I can define an array as a parameter, but only one dimensional array. Does anybody know a good solution to store a multidimensional array?
Thanks
if one dimension is fixed and numbers are ok you can use point2, point3, point4, or matrix3 tab.(corresponding to x2, x3, x4, x12)
These tabs are not good for me.
Details:
I want to create a three axis skin modifier. I need three weight maps (different weight maps for each axis). I have to store the weight values in the modifier, so I need the following array to store:
weight => (x => ([indent]vertex1 => ([indent]bone1 = 0.817
bone2 = 0.183
)
vertex2 => (bone1 = 0.4
bone2 = 0.6
)
[/indent])
y => (vertex1 => ([indent]bone1 = 0.817
bone2 = 0.183
)
vertex2 => (bone1 = 0.4
bone2 = 0.6
)
[/indent])
[/indent]etc…
Do you have any ideas?
(The indent doesn’t work in the text editor):sad:
so you can use matrix3 tab where one matrix for each vertex. first row of every matrix is bone ids, second is x-weights, third is y-weights, and fourth is z-weights
Oh yes. You’re right. Now I understand what you said.
That’s a brilliant idea. Thank you very much.
it would be better to use 1,2, and 3 rows as x,y, and z. and 4th row as bone ids. because matrix3 the first row means x-axis, and etc.
Sorry, but I have a problem.
3 bones is not enough. In some cases I need 8 bones for one vertex.
Do you have another great idea?
Thanks
the best i can suggest is using of 4 matrix3 tabs… one tab of bone ids (up to 12), tab of x-weights, y-weights, and z-weights.
another solution is to have only one string parameter, put all information you want to store as a string. on plugin loading dump (execute) this data in plugin local space, work with this data, and put it back when plugin is about to close (close its rollout for example)
This is similar to what I do, although I use a stringTab as it simplifies multiple sets of data. I format the data into an XML document string to store, and use LINQ or XPath to parse it.
the access (get/set) to any param block tab item via mxs is very slow. that why i prefer to use a single and flat parameter.
Thanks for the suggestions. Maybe the stringTab solution is better than the matrix3Tabs.
But I don’t know. I will think about both solutions.
Thank you
The whole thing is very slow. Reading weight values for 21000 vertices and transforming them is really slow. I’m very disappointed. It should be better to write this modifier in C++
But I only know maxscript