How to use Maxscript to add animation group nodes?

Code:
maxScriptManager = dotNetObject “Max2Babylon.MaxScriptManager”
aniGroup=maxScriptManager.CreateAnimationGroup()
maxScriptManager.RenameAnimationGroup aniGroup “TestAni”
testAni=maxScriptManager.GetAnimationGroupByName “TestAni”

id = $.handle
type = dotnetclass “System.UInt32”
uID = dotnet.ValueToDotNetObject id type
uID.tostring()

maxScriptManager.AddNodeInAnimationGroup testAni uID

format "AnimationGroupNodes is % " testAni.AnimationGroupNodes

Assiging to @Guillaume_Pelletier our exporter master :slight_smile:

Be aware that there might be a slight delay with his answers related to the vacations

Hey guys, i will try to have a look this week. Have a great christmas.

1 Like

Ok Guys, there was a bug which prevent script to relay on the correct AnimationGroup to add the node. I solved it and publish a PR related to it. Be aware that there might be a delay for the PR to be merge.
Assuming a Group named “Animation” exist, the following script

manager = dotNetObject “Max2Babylon.MaxScriptManager”
g = manager.GetAnimationGroupByName “Animation”
id = $.handle
manager.AddNodeInAnimationGroup g id

works now.

Happy christmas.

3 Likes

GG @Guillaume_Pelletier

thank!
Happy christmas.

Hiello. Thank you for what you explained. I can create a group and add nodes, but when i try to change the FrameStart and the FrameEnd of the animation group in maxscript, the values are not correctly stored. What’s wrong ? How to do ?
Moreover, do you know where i can find all the properties/attributes of the dotNetObject “Max2Babylon.MaxScriptManager” ? (as “CreateAnimationGroup”, “RenameAnimationGroup”, etc.)
Thank you for your help.

maxScriptManager = dotNetObject “Max2Babylon.MaxScriptManager”
aniGroup=maxScriptManager.CreateAnimationGroup()
maxScriptManager.RenameAnimationGroup aniGroup “TestAni”
testAni=maxScriptManager.GetAnimationGroupByName “TestAni”

testAni.framestart = 10 → this property exists but the value is not crorrectly stored and exported