change node list into a single node in the ParamBlock2desc

change node list into a single node in the ParamBlock2desc

bdenhartog
Explorer Explorer
712 Views
1 Reply
Message 1 of 2

change node list into a single node in the ParamBlock2desc

bdenhartog
Explorer
Explorer

We have a paramblock in which the user can pick objects in the scene to connect them to our own object. (See picture)
screenshot.png
With a paramblock2 descriptor snippet:

constraint_list_body1, _T("body1"), TYPE_INODE_TAB, 0, P_VARIABLE_SIZE, IDS_CONSTRAINT_BODY1_LIST,
p_ui, TYPE_NODELISTBOX, IDC_EABASE_LIST1, 0, 0, 0,
p_end,

It works, however the max script programmers now need to index the parameter if they use it from script.
For example:
object.body1[1] = picked_object

instead of:
object.body1 = picked_object

Can anyone help me with this? I haven't found the correct paramblock2desc syntax to make this work.
Thanks in advance!

 

 

0 Likes
713 Views
1 Reply
Reply (1)
Message 2 of 2

istan
Advisor
Advisor

@bdenhartog wrote:

We have a paramblock in which the user can pick objects in the scene to connect them to our own object. (See picture)

With a paramblock2 descriptor snippet:

 

constraint_list_body1, _T("body1"), TYPE_INODE_TAB, 0, P_VARIABLE_SIZE, IDS_CONSTRAINT_BODY1_LIST,
p_ui, TYPE_NODELISTBOX, IDC_EABASE_LIST1, 0, 0, 0,
p_end,

 

It works, however the max script programmers now need to index the parameter if they use it from script.
For example:
object.body1[1] = picked_object

instead of:
object.body1 = picked_object

Can anyone help me with this? I haven't found the correct paramblock2desc syntax to make this work.
Thanks in advance!


Did you search for "TYPE_INODE_TAB" in the samples? What does "showproperties $" show?

Your 'body1' variable should display as type 'node array'.

And with MXS use 'append' to add new nodes to the list.

0 Likes