View Full Version : skinOps.addBone trouble!

01 January 2010, 12:08 PM
Hi everyione!
I need a script that will assign bones and vertex weights to the merged model..
Ive gor merged model, add skin on it..and when i try to addBone..ive got "** system exception **" message..
and even when i made test scene with 1 box and 1 bone..and tried to add it ive got the same..

skinOps.addBone $.modifiers[#Skin] $Bone01 1

** system exception **
what am i doing wrong?

01 January 2010, 01:07 PM
and even when i try to load evelope:
max modify mode
modPanel.setCurrentObject skin_mod
sk_destination="D:\scripts\MY_OWN_SCRIPTS\skin copy\shared_vest_np.env"
skinOps.LoadEnvelope skin_mod sk_destination

i get -- Runtime error: Skin need to be selected and in the modifier panel Skin:Skin

i try this in 2010 max...

01 January 2010, 05:55 PM
I believe you actually need the skin modifier selected in the modifier panel :S

01 January 2010, 11:32 PM
Hi CyHiSo.

SkinOps have some limitations and can be used only on certain conditions:

. The object must be selected.
. The skin should be the active modifier and visible.

Here a function that can help you, I use it all the time.

Function PrepareMaxForSkinOps _pNode =
-- Select @_pNode if needed.
if not _pNode.IsSelected do
Select _pNode

-- Unfreeze @_pNode if needed.
if _pNode.IsFrozen do
Unfreeze _pNode DoLayer:true

-- Set Modify Panel active if needed.
if GetCommandPanelTaskMode() != #modify do
SetCommandPanelTaskMode mode:modify

-- Set @_pNode skin modifier as current object in modpanel if needed.
if ModPanel.GetCurrentObject() != do

01 January 2010, 08:09 AM
thanks to all of you. but i solved the problem. in our company we have our variation of skin modifier..and it ovelays standart skin in maxscript) so i should write proper name for modificator name)

CGTalk Moderation
01 January 2010, 08:09 AM
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.