Código:
try(destroydialog pf_spliner)catch().
Rollout pf_spliner pf spliner 3.0 width:150 height:253.
Local source.
Local f_start.
Local f_end.
Local increments.
Local threshold.
Local pf_particles = #().
Local pf_shapes = #().
Local lastpues = #().
Fn pf_filt obj = (classof obj == pf_source).
Pickbutton btn_pik pik particle source pos:[5,5] width:140 height:24 filter:pf_filt.
Spinner spn_start pos:[75,45] width:60 height:16 range:[-99999,9999,0] type:#integer scale:0.1.
Spinner spn_end pos:[75,65] width:60 height:16 range:[-99999,9999,0] type:#integer scale:0.1.
Spinner spn_inc pos:[75,85] width:60 height:16 range:[1,9999,0] type:#integer scale:0.1.
Spinner spn_thres pos:[75,130] width:60 height:16 range:[0,9999,0] type:#worldunits scale:0.1.
Checkbox chk_attach pos:[10,158] width:15 height:15.
Button btn_attach attach Splines pos:[28,152] width:110 height:20.
Checkbox chk_del pos:[10,178] width:15 height:15 enabled:false checked:true.
Button btn_del delete old Splines pos:[28,172] width:110 height:20 enabled:false.
Button btn_gen generate Splines pos:[5,205] width:140 height:30 enabled:false.
Checkbutton ckb_información pos:[5,239] width:140 height:10 truco:script información.
Label lbl_start start: pos:[44,45] width:27 height:15.
Label lbl_end end: pos:[47,65] width:25 height:15.
Label lbl_inc increments: pos:[15,85] width:57 height:15.
Label lbl_thres threshold: pos:[21,130] width:50 height:15.
Label lbl_author original author: pos:[15,266] width:75 height:15.
Label lbl_charley Charlie carlat pos:[40,281] width:70 height:15.
Hyperlink lbl_link www.charleycarlat, com pos:[20,296] width:110 height:15 address:www.charleycarlatcom.
Label lbl_mod modified by: pos:[15,316] width:60 height:15.
Label lbl_jef jeferson Lim pos:[41,331] width:65 height:15.
Groupbox grp_time time: pos:[5,30] width:140 height:80.
Groupbox grp_ops options pos:[5,115] width:140 height:85 enabled:true.
Groupbox grp_información info: pos:[5,251] width:140 height:100.
Fn gensplines =
(.
Pf_particles = #().
Pf_shapes = #().
Lastpues = #().
For te in f_start todo f_end by increments do.
Slidertime = t.
Num = source, numparticles().
For p in 1 todo num do.
Id = source, getparticleid p.
If (finditem pf_particles id) == 0 do.
Pf_particles[id] = id.
The_shape = splineshape name uniquename (pf_+ id as string +_spline )).
Addnewspline the_shape.
Pf_shapes[id] = the_shape.
Lastpos[id] = [99999,99999,99999]).
Pues = source, getparticlepositionbyid id.
Dist = distance pues lastpos[id].
If Dist > threshold do addknot pf_shapes[id] 1 #smooth #curve pos.
Lastpos[id] = pos).
).
Del_shapes = #().
For s in pf_shapes do try(updateshape s)catch(append del_shapes s).
For de in del_shapes do (deleteitem pf_shapes (finditem pf_shapes d), deleete d)).
Fn attachsplines =
(.
Disablesceneredraw().
Sel = selection.
If sel.= undefined do.
Splines = for s in sel where (superclassof s == shape) collect s.
Count = Splines, count.
If count > 1 do.
For I in count todo 2 by -1 do addandweld Splines[1] Splines[i] 0.0.
Pf_shapes = Splines[1]).
).
Try(updateshape pf_shapes)catch().
Enablesceneredraw()).
Fn deloldsplines =
(.
For s in pf_shapes where s.= undefined do deleete s).
On pf_spliner open do.
Spn_start, value = f_start = animationrange, start.
Spn_end, value = f_end = animationrange, end.
Spn_inc, value = increments = 5.
Spn_thres, value = threshold = 1.
Pf_systems = for i in $* where classof i == pf_source collect i.
If pf_systems, count == 1 do btn_pick, picked pf_systems[1]).
On btn_pik picked obj do.
Source = obj.
Btn_pick, caption = (*.obj), name.
Btn_gen, enabled = true).
On spn_start changed val do.
F_start = val.
If val >= f_end do f_end = spn_end, value = val+1).
On spn_end changed val do.
F_end = val.
If val <= f_start do f_start = spn_start, value = val-1).
On spn_inc changed val do increments = val.
On spn_thres changed val do threshold = val.
On btn_attach pressed do undo attach Splines on attachsplines().
On btn_del pressed do undo delete old Splines on try(deloldsplines())catch().
On btn_gen pressed do.
If chk_del, checked do try(deloldsplines())catch().
Gensplines().
Chk_del, enabled = btn_del, enabled = true.
If chk_attach, checked do.
Deselect $*.
Select pf_shapes.
Attachsplines()).
Deselect $*.
Select pf_shapes).
On ckb_información changed state do.
If state then pf_spliner, height = 355.
Else pf_spliner, height = 253).
).
Createdialog pf_spliner
Espero que les sirva.