PDA

View Full Version : Gmax maxscript


pabtyf
02-10-2005, 01:31 PM
Hi there.
I'm totally new to all this but i'll try and make myself clear.

I'm trying to edit modells for a game using gmax (and renx gamepack).
I've got the 'skin' bound to the spacewarp with the bones etc.

What I want to do is select the vertices by number here so I can bind them to the right bones (using an existing model as reference).

I found a script for it:
setVertSelection (getCurrentSelection()) #(1)

but this only works in editable mesh mode.
is there a way i can do the same thing when binding verts to bones.

if I type getCurrentSelection() it shows that the mesh is selected, and not any verts that I have selected.

Can anyone help?

Bobo
02-10-2005, 04:07 PM
Hi there.
I'm totally new to all this but i'll try and make myself clear.

I'm trying to edit modells for a game using gmax (and renx gamepack).
I've got the 'skin' bound to the spacewarp with the bones etc.

What I want to do is select the vertices by number here so I can bind them to the right bones (using an existing model as reference).

I found a script for it:
setVertSelection (getCurrentSelection()) #(1)

but this only works in editable mesh mode.
is there a way i can do the same thing when binding verts to bones.

if I type getCurrentSelection() it shows that the mesh is selected, and not any verts that I have selected.

Can anyone help?


Gmax was based on the Max 4 core. I am not completely sure that the function to select vertices in Skin was available in Gmax, but you might want to try it out and see if it does anything:

From the MAXScript Reference:

skinOps.SelectVertices <Skin> ( <vertex_integer> | <vertex_array > | <<vertex_bitarray> )
Selects the specified vertices.


This means that if your mesh has a Skin modifier, the above syntax would be used like this:

skinOps.SelectVertices $.skin 1 --select one vertex
skinOps.SelectVertices $.skin #(1,2,3,4,5,6,7,8,9,10,20,100) --select multiple vertices
skinOps.SelectVertices $.skin #{1..10,20,100} --same as above using bitArray

Note that $ is a quick and dirtly replacement for getCurrentSelection(). If you have more than one object selected, the script will fail.

Once again, this function might NOT be part of the Gmax MAXScript implementation, I have no way to check it out...

Hope it works.

Cheers,
Bobo

pabtyf
02-10-2005, 04:24 PM
Thanks I will give it a try later.
I spotted that skinOps stuff in the reference files but wasn't sure of the syntax.

pabtyf
02-10-2005, 04:30 PM
Comes back with this message:

-- Unknown property: "Skin" in $Editable_Mesh:TROLL_MESH @ [0.000000,0.000000,0.000000]

The name of the modifier is wwskin, so i tried that in place of skin too, with similar results.

Thanks anyway!
(guess i'll just have to do it by hand!)

Bobo
02-10-2005, 07:41 PM
Comes back with this message:

-- Unknown property: "Skin" in $Editable_Mesh:TROLL_MESH @ [0.000000,0.000000,0.000000]

The name of the modifier is wwskin, so i tried that in place of skin too, with similar results.

Thanks anyway!
(guess i'll just have to do it by hand!)

You can check the MAXScript Reference that came with Gmax for the list of available functions.
You can also try typing in the Listener:

skinops.help

(or skinops. followed by anything that is not part of the structure like skinops.bla :) ).

The result should be an error message listing all available functions. If the one you need is not there, then Gmax does not support it.

To get a modifier, you can also use $.modifiers[#wwskin] or $.modifiers[1] (assuming the Skin modifier is the top modifier on the stack).

pabtyf
02-10-2005, 07:56 PM
Thanks again for your help.
will try it again later.

CGTalk Moderation
02-10-2006, 08:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.