a new little tool
-drag&drop the file into max viewport
-create new link OR use existing one
(-select link)
-pick Dragger, choose Vert, pick object to drag/link
-activate
-render
-have phun
Ah, thank you so much! I’ll go and give it a shot right now!! You are a star!!!
new params added:
try(destroydialog pathBinder) catch()
global PB_Path
global PB_Position = if PB_Position == undefined then [100,100] else PB_Position
global PB_PathOptions = if PB_PathOptions == undefined then #(on, on, on, 0.1, 0.5, off) else PB_PathOptions
global PB_HelperOptions = if PB_HelperOptions == undefined then #(10, 1, units.decodevalue "0.1m") else PB_HelperOptions
rollout pathBinder "Path Binder by denisT"
(
fn isShape obj = iskindof obj Shape
fn isBindHelper obj path: = isShape path and isvalidnode obj and
(
iskindof (c = obj.pos.controller) Path_Constraint and c.path == path
)
fn getHelpers path = for obj in (refs.dependentnodes path) where isBindHelper obj path:path collect obj
fn createBinder path num:0 options:PB_PathOptions settings:PB_HelperOptions = if isShape path do
(
suspendEditing()
delete (getHelpers path)
local step = 100.0/(num-1)
local track = Path_Constraint path:path follow:options[1] bank:options[2] bankAmount:options[4] smoothness:options[5] \
constantVel:options[3] allowUpsideDown:options[6]
local type = if settings[2] == 1 then Point else Dummy
local i = type name:(uniquename "TEMP_Helper") size:settings[3] boxsize:([settings[3],settings[3],settings[3]]/2)
local bind_helpers = at time 0 with animate off for k=0 to num-1 collect
(
p = instance i
p.wirecolor = green
p.name = uniquename "PB_Helper"
p.pos.controller = c = copy track
deletekeys c #allkeys
c.percent = k*step
p
)
delete i
gc light:on
resumeEditing()
bind_helpers
)
fn updateBinder path num:0 options:PB_PathOptions settings:PB_HelperOptions = if isShape path do
(
suspendEditing()
local bind_helpers = getHelpers path
local step = 100.0/(num-1)
local type = if settings[2] == 1 then Point else Dummy
local i = type name:(uniquename "TEMP_Helper") wirecolor:green size:settings[3] boxsize:([settings[3],settings[3],settings[3]]/2)
at time 0 with animate off for k=0 to bind_helpers.count-1 do
(
obj = bind_helpers[k+1]
c = obj.pos.controller
c.follow = options[1]
c.bank = options[2]
c.constantVel = options[3]
c.bankAmount = options[4]
c.smoothness = options[5]
c.allowUpsideDown = options[6]
c.percent = k*step
case type of
(
Point: if not iskindof obj type then instancereplace obj i else obj.size = settings[3]
Dummy: if not iskindof obj type then instancereplace obj i else obj.boxsize = [settings[3],settings[3],settings[3]]/2
)
obj.wirecolor = green
)
delete i
gc light:on
resumeEditing()
bind_helpers
)
pickbutton pick_path "Pick Path" filter:isShape width:190 align:#left offset:[-8,0] tooltip:"Pick as Shape to use as a Path"
edittext name_path readonly:on width:194 align:#left offset:[-12,-2]
button selPath "Select Path" across:2 width:94 align:#left offset:[-8,0] tooltip:"Select Current Path"
button selHelpers "Select Helpers" width:95 align:#right offset:[9,0] tooltip:"Select Binder Helpers"
group "Path Options: "
(
checkbox follow "Follow" across:2 checked:PB_PathOptions[1]
checkbox bank "Bank" checked:PB_PathOptions[2] align:#right offset:[-8,0]
spinner bank_amount "Bank Amount: " range:[-1e9,1e9,PB_PathOptions[4]] type:#float scale:0.01 fieldwidth:50 align:#right offset:[4,0]\
tooltip:"Controller Bank Amount"
spinner bank_smooth "Smoothness: " range:[0,10,PB_PathOptions[5]] type:#float scale:0.01 fieldwidth:50 align:#right offset:[4,0]\
tooltip:"Controller Smoothness"
checkbox upside "Allow Upside Down" checked:PB_PathOptions[6]
checkbox constant "Constant Vecocity" checked:PB_PathOptions[3]
)
spinner num_helpers "Number Helpers: " range:[0,100,PB_HelperOptions[1]] type:#integer fieldwidth:50 align:#right offset:[4,10]\
tooltip:"Number Helpers in Path Binder System"
group "Helper Options: "
(
label lbType "Type:" across:3 align:#left offset:[0,0]
radiobuttons helperType labels:#("Point", "Dummy") columns:1 default:PB_HelperOptions[2] align:#left offset:[-26,-1]
spinner helperSize "Size: " range:[0,1e9,PB_HelperOptions[3]] type:#worldunits fieldwidth:50 align:#right offset:[4,0]\
tooltip:"Helpers Size"
)
button create "Create" across:2 width:94 align:#left offset:[-8,0] tooltip:"Create Path Binder System"
button update "Update" width:95 align:#right offset:[9,0] tooltip:"Update Path Binder System"
fn pickPath path = (name_path.text = if isShape (PB_Path = path) then path.name else "undefined")
on follow changed state do PB_PathOptions[1] = state
on bank changed state do PB_PathOptions[2] = state
on bank_amount changed val do PB_PathOptions[4] = val
on bank_smooth changed val do PB_PathOptions[5] = val
on constant changed state do PB_PathOptions[3] = state
on upside changed val do PB_PathOptions[6] = val
on num_helpers changed val do PB_HelperOptions[1] = val
on helperType changed state do PB_HelperOptions[2] = state
on helperSize changed val do PB_HelperOptions[3] = val
on create pressed do undo "Create Path Binder" on createBinder PB_Path num:PB_HelperOptions[1]
on update pressed do undo "Update Path Binder" on updateBinder PB_Path num:PB_HelperOptions[1]
on pick_path picked obj do pickPath obj
on selPath pressed do undo "Select" on if (isShape PB_Path) then select PB_Path else clearselection()
on selHelpers pressed do undo "Select" on if (isShape PB_Path) and (objs = getHelpers PB_Path).count > 0
then select objs else clearselection()
on pathBinder moved pos do PB_Position = getdialogpos pathBinder
on pathBinder open do pickPath PB_Path
)
createdialog pathBinder width:200 height:320 pos:PB_Position
Hey mate! Well the upside down option works like a treat, they now keep the same orientation. Unfortunately they still flip from left to right and vice versa!
I’ve posted a video of the results…
If anyone can figure out a way to stop them flipping that would be such a help. I wish I had the ability but I’m one of those practical artists where the tools just get in the way!
Thanks in advance
Tris
You’ll need a common axis – i.e probably a forward face axis, then you can build a matrix using it along with the direction t > t+1 of each knot down the spline. Tangents can be tricky down splines especially when you want them to twist and such.
Hey. Cheers for the reply. Yeah, I managed to come up with a work around but it would have been interesting to know.
I basically created equal amount of bones to the helpers and attached a spline solver which obviously creates its own point helpers at the joints, then linked those points to the points on the spline and it works like a treat.
Would have been more practical if I didn’t have to do that, as now I have almost 6 tentacles, 3 of which have tonnes of bones etc etc… but I’m just pleased it works for now
Maybe I didn’t understand correctly what you’ve wanted but if I did, I think you’re complicating the problem…
I’ve did some testing and since you’re using reactor/reactor rope, can’t you just define some deforming meshes, create a constrain on the reactor rope (attach to defmesh) and that’s it? I’ve attached a file and a preview. I hope this helps and if I understood wrong, sorry
Cheers!