Search the Community
Showing results for tags 'maxscript'.
Found 1 result
Maxscript - Delete spline segments not working inside functions
niculaegeorge posted a topic in Autodesk 3ds MaxGoal: Create a quarter of an ellipse, and elevate one of its points. I’ve manage to make it work, but inside a function, everything falls apart. Obviously from the code that I’m a beginner, so this is it: Delete $* clearlistener () function test var1 = ( Ellipse adaptive: true length:10 width:var1 pos:[0,0,0] name: "s" convertToSplineShape $s updateshape $s Select $s modPanel.setCurrentObject $s.baseObject --this line is optional subobjectLevel = 2 setSegSelection $s 1 (#(1,3,4)) --keep: false –delete all except second quadrant splineOps.delete $ --everything is ok until now --actionMan.executeAction 0 "40020" -- worked for a while, then it started to delete the entire shape subobjectLevel = 0 --this is where everything goes berserk, I tried "=2" as well, still not working. updateshape $s --clearselection() addmodifier $s (Spline_IK_Control helper_size: 0.5 linkTypes: 2 box:off helper_cross: on wirecolor: yellow) updateshape $s $s.spline_ik_control.createHelper ($s.spline_ik_control.getKnotCount()) clearselection() move $Point001 [0,0,10] --point repositioning not working on the second run of the code $Point001.pos.z =10 --not working either when the code is run second time ) test 20 Point repositioning in the last lines at first they did not work, then it started again but point002 start to move as well, then it only worked after the second execution of the code in a fresh environment. I feel like I’m in the Twilight Zone... at line subobjectlevel = 0 after the splineops.delete $ command, the segments reappear as if the delete command did not took hold. Like it was a temporary delete of somekind. I've tried resetshape, updateshape, clearselection, and many things in different arrangements. Is there a command like „clear and empty all variables and reset the entire environment for a fresh start” to place at the start of the code? What am I missing here? My guess is that I'M NOT EXITING FROM THE SUB-OBJECT EDITING MODE PROPERLY and thus the results are not embedded and printed out of from the shape cache or something. And probably that is why the final repositioning of a spline IK point is not working properly, since I’m still in a somekind of a sub-object editing mode.