Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / refinesegment after animatevertex causes max crash
  RSS 2.0 ATOM  

refinesegment after animatevertex causes max crash
Rate this thread
 
60309
 
Permlink of this thread  
avatar
  • Total Posts: 9
  • Joined: 31 March 2008 02:55 PM

Hello

I try to make a script to animate a spline with helper.

So I produce controllers on the knots and the beziers vectors with animatevertex and I create script controller on the knots to link the knots to the helpers and that’s works fine.

After that i want to make a script to add knot on the spline. So I create additional knot with refinesegment ().  I update the shape and when i want to move the knots max crashes. Same issue with addknot ().

I’m confuse because when I refine the spline manually everything is ok.
I noticed that when i refine the spline manually the knot number integer is update in the curve editor.
For example if i add a knot between the knot 1 and 2 the vertex 2 is renamed as vertex 3 and if I delete the new knot 2, the vertex 3 is renamed vertex 2 again.

I don’t hunderstand why i can’t do with maxscript what I do with the mouse.
Is there someone who known the same problem and who fixed it?
Is it a maxscript bug? Sometime I get a max.net message error before max crashes.

I think to workaround, i would save the vertex controllers, delete them from the spine, refine the spline et paste the saved controller to the appropriate vertex.
But I don’t know how to delete the controller, if someone could help me…

I’m new to maxscript. Usually i find solutions to my problems in the others topics and i’m very grateful to the community for that. But this time i can’t solve the problem by myself.

Thank you and sorry for my english.



Replies: 0
avatar

To explicit my problem i post the script which produce the crash.
After you evaluated it try to move the last knot of the spline and max should crash.
If you add the knot manually instead of using the last part of the script you will see that all is OK.

-- spline creation
line ()

addnewspline s
addknot s 1 
#smooth #curve [0, 0, 50]
addknot s 1 #smooth #curve [50, 0, 0]
addknot s 1 #smooth #curve [100, 0, 50]

updateshape s

-- controller vertex creation
animatevertex s 
#all
updateshape s

-- add one new knot to the spline
refinesegment s 1 1 0.5
updateshape s


Replies: 0
avatar

Hello,

Denis from cg talk solved may problem
here is the good code

-- spline creation
  s 
line () 
  
  
addnewspline s
  addknot s 1 
#smooth #curve [0, 0, 50]
  
addknot s 1 #smooth #curve [50, 0, 0]
  
addknot s 1 #smooth #curve [100, 0, 50]
  
  
updateshape s
  
  
-- controller vertex creation
  animatevertex s 
#all
  
updateshape s
  
  
-- add one new knot to the spline
 addmodifier s 
(Edit_Spline())
 
convertto s SplineShape 
 refinesegment s 1 1 0.5
 updateshape s


Replies: 0