Notifications
Clear all

[Closed] Position Bias via maxscript

This is what I have so far.
This is what I’ve got so far. If you open the max file I’ve attached and selected the little pile of spheres and run the script it will work.

Aside from that the script is not stream line enough. If you change  the sphere count it does not work properly. Hoping to get some other  opinions or help.
Thanks

ps: How do you post a code nippet on here?
here is the start scene http://www.scriptspot.com/files/testbias.max

startPos = $Sphere013.pos 

endPos = $Sphere009.pos
selObjs = (selection.count)
clearlistener()
for i=1 to (selObjs) do
(
userPerc = 66.6666666666
PerVal = userPerc*.01
PerChange = (PerVal/selCount)*(i+1)
print PerVal
print PerChange
Part1 = (endPos-startPos)
Part2 = (i as float)/(selObjs+1)PerChange
PosPerct = (startPos + (Part1
Part2))
print PosPerct
Obj = Selection[i]
Obj.pos = PosPerct
)

2 Replies
PerChange = (PerVal/selCount)*(i+1)        

need to change to this to work.

PerChange = (PerVal/selObjs)*(i+1)

This is kinda working for what I want.
Anyone have any ideas on making this better?