Home Coding, Scripting, Shaders

Script like 3dsmax spacing tool that not clone objects

sefiroths
polycounter lvl 4
Offline / Send Message
sefiroths polycounter lvl 4
Hi, I want a script that align selected objects over a spline.
let’s say I have 40 cards and Iwant to align on a circular path.
there is in 3ds Max such a tool?

thanks

Replies

  • Klunk
    Offline / Send Message
    Klunk ngon master
    fn create_path_constrait the_path loop t delkeys: = 
    (
    	pcon = Path_Constraint();
    	pcon.path = the_path;
    	pcon.percent = t;
    	pcon.loop = loop;
    	pcon.constantVel = true;	-- make evenly spaced
    	pcon.follow = true;
    	if delkeys != unsupplied and delkeys == true then deleteKeys pcon #allkeys;
    	pcon	
    )
    
    fn align_to_path the_path the_nodes =
    (
    	num_of_nodes = the_nodes.count;
    	t = 100.0/num_of_nodes;
    	
    	for i = 1 to num_of_nodes do
    	(	
    		the_nodes[i].position.controller = create_path_constrait the_path true (t * i ) delkeys:false;
    	)
    )	
    
    align_to_path $Circle01 $
    

    in it's simplest form something like this ?
  • sefiroths
    Offline / Send Message
    sefiroths polycounter lvl 4
    Wow very clean code! I ended up with a very bad code, I’ll post it when I’ll be on my pc
  • sefiroths
    Offline / Send Message
    sefiroths polycounter lvl 4
    only one thing... after the script run the position of the object are constrained to that path, there is a way to modify freely that position after set?
  • Klunk
    Offline / Send Message
    Klunk ngon master
    select the object, go to motion panel on PRS params select position which should throw up the Path Parameters rollout panel from there you can set the % along path value.
    or type in 
    $.pos.controller.Path_Constraint.controller.percent = 25
    into max script listener window follow by enter

Sign In or Register to comment.