wuhao1117
Hi all,

If I want to have an input attribute that can store an array of positions that can change its size dynamically according to how many position vectors it currently has, what should I do? This is my bubble simulation node problem again, original post http://soup-dev.websitetoolbox.com/post/Extract-velocity-field-from-fluidShape-6276212.

I wish to let user specify any number of bubble emitters (represented as spheres) and the positions of the emitters should be able to be changed by dragging the manipulators' axes. So if I can find a way to connect each translate attribute of the transform node of each sphere to my bubbleSim node, the emitter positions will be able to be changed on the fly. Though it seems a simple and straightforward issue, I just can't find the right attribute to dynamically hold those position data because the number of emitters is not known beforehand. Will MFnArrayAttrsData.kDynArrayAttrs do the trick? I also read through examples related to MArrayDataBuilder and MArrayDataHandle and hopefully could get some inspiration but no avail...

I know I may be missing some very fundamental points here. Sorry for being naive. Any help will be appreciated, thanks a lot!
Reply 0 0
pshipkov
You need compound attribute with array flag turned on. Then you can use MPlug or MArrayDataBuilder to access or create the data.
There is an example plugin that shows some of that stuff - something with "weight" in the name. Cannot remember right now.
Reply 0 0
Reply