Notifications
Clear all

[Closed] Spacing tool like functionality with path constraint

Hi

i need to evenly place objects on line for that i m using path constraint . i need Endoffset and startoffset functionality just like with spacing tool.

here the code:

  fn placeAlongPath_ node _path num startOffset endOffset = 
(
	Len=(curveLength _path)
	st_per=(1/(Len/100.0))*startOffset
	end_per=(1/(Len/100.0))*(Len-endOffset)
	gap =(end_per-st_per)/(num-1)
	
	pcns=createinstance path_constraint path:_path percent:st_per loop:false follow: true 
	deleteKeys pcns #allkeys
	node.position.controller =pcns
	naam=filterstring _path.name "_"
	i=1
	nodes = #(node)
	
	for k=2 to num do
	(
		maxOps.CloneNodes node cloneType:#instance newNodes:&new
		new[1].pos.controller.percent = st_per+((k-1) * gap)
		join nodes new
		i+=1
	)
	#(nodes, _path)
)

I need following code in expression on percent value of each node with startOffset and endOffset connected to spinners on custum attribute of line.

         Len=(curveLength _path)
          st_per=(1/(Len/100.0))*startOffset
          end_per=(1/(Len/100.0))*(Len-endOffset)
           gap =(end_per-st_per)/(num-1)

english is not my language so difficult for me to explain.
this is what i need

thanks.