[Closed] Maxscript & Reaction Manager
With 3 targets, I have tried this :
paramWire.connect s0.baseobject.blendAttr[#blend] c[1] “if Blend<=50.0 then(100.0-2Blend)else(0.0)”
paramWire.connect s0.baseobject.blendAttr[#blend] c[2] “if Blend<50 then(2Blend)else(if Blend>50 then(100-2*(Blend-50))else(100))”
paramWire.connect s0.baseobject.blendAttr[#blend] c[3] “if Blend>=50.0 then(2*Blend-100)else(0.0)”
It seems to work correctly, but for 4 or more, it’s gonna be tricky , or is there a simple way ?
undo on, redraw off
(
delete objects
t1 = dummy name:"target1" pos:[-20,0,0] boxsize:[5,5,5]
t2 = dummy name:"target2" pos:[0,-20,0] boxsize:[5,5,5]
t3 = dummy name:"target3" pos:[20,0,0] boxsize:[5,5,5]
t4 = dummy name:"target4" pos:[0,20,0] boxsize:[5,5,5]
s0 = dummy name:"source" pos:[0,0,0] boxsize:[10,10,10] isselected:on
custattributes.add s0 blendAttr baseobject:on
c = s0.position.controller = Position_Constraint()
c.appendTarget t1 100
c.appendTarget t2 0
c.appendTarget t3 0
c.appendTarget t4 0
paramWire.connect s0.baseobject.blendAttr[#blend] c[1] "100-3*Blend"
paramWire.connect s0.baseobject.blendAttr[#blend] c[2] "100-3*abs(Blend-100./3)"
paramWire.connect s0.baseobject.blendAttr[#blend] c[3] "100-3*abs(Blend-200./3)"
paramWire.connect s0.baseobject.blendAttr[#blend] c[4] "3*(Blend-200./3)"
ok
)
and why do you think that the reactor controller can solve this task easier?
YEAHH !!! thank you very much for that, I would be able to adapt it perfectly in my case.
I thought using MR would have been easier, because for some reactions, it would not have been weights to target, but some given rotations for example. That’s why I thought it would be easier to define them in MR and assign each value to a %of the slider