Skip to content

Instantly share code, notes, and snippets.

@Swordslayer
Created April 27, 2022 17:06
Show Gist options
  • Save Swordslayer/9e65eb35b5928ee27cf932937c9227ac to your computer and use it in GitHub Desktop.
Save Swordslayer/9e65eb35b5928ee27cf932937c9227ac to your computer and use it in GitHub Desktop.
How to to object instance without creating a scene node.
(
local iGlobal = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
local boxObj = createInstance Box
local turboObj = TurboSmooth iterations:3
local derObj = iGlobal.CreateDerivedObject (iGlobal.Animatable.GetAnimByHandle (getHandleByAnim boxObj))
derObj.AddModifier (iGlobal.Animatable.GetAnimByHandle (getHandleByAnim turboObj)) undefined 0
local objState = derObj.Eval currentTime.ticks 0
-- just to show the result, let's create some object with the snapshot of the stack as its baseobject
Plane baseObject:(getAnimByHandle ((iGlobal.Animatable.GetHandleByAnim objState.Obj asDotNetObject:on).ToUInt64())) isSelected:on
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment