Notifications
Clear all

[Closed] paramwire.disconnect troubles

well… what did you connect? show me your wire connection script.

7 Replies
(@mackinder)
Joined: 11 months ago

Posts: 0

Sure no problem.


paramWire.connect pickJS.object.pos.controller.X_Position.controller[#Limited_Controller__Bezier_Float] pickMesh.object.modifiers[#Morpher][(selectedMorph)](toExpression)


There’s no space between “controller” and “[#Limi…” obviously. Also although we’ve just been looking at code for Y_Position this is just the first example of the connection in the script.

Thanks again man.

(@denist)
Joined: 11 months ago

Posts: 0

so you have to ask dependents of:
pickJS.object.pos.controller.X_Position.controller[#Limited_Controller__Bezier_Float].controller

(@mackinder)
Joined: 11 months ago

Posts: 0

But then goes back to returning:

#(Controller:Float_Limit, Controller:Position_XYZ, Controller:Position_Rotation_Scale, $Circle:JoystickNameCircleController @ [0.000000,0.000000,0.000000], ReferenceTarget:NodeSelection, ReferenceTarget:ReferenceTarget)

Which doesn’t indicate any reference to the morph target. Am I missing a step here?

Cheers.

(@denist)
Joined: 11 months ago

Posts: 0

what does refs.dependson say about the same controller?

(@mackinder)
Joined: 11 months ago

Posts: 0

Bugger, I was entering in the wrong position in the post before; it’s actually returning:

#(Controller:Float_Wire, ReferenceTarget:ParamBlock, Morpher:Morpher, ReferenceTarget:ModApp, ReferenceTarget:DerivedObject, $PolyMesh:Teapot001 @ [-63.105194,0.000000,0.000000], Controller:Float_Limit, Controller:Position_XYZ, Controller:Position_Rotation_Scale, $Circle:JoystickNameCircleController @ [0.000000,0.000000,0.000000], ReferenceTarget:NodeSelection, ReferenceTarget:ReferenceTarget)

So it is now referencing the Morher, but not the slot.

If I change it to dependson then I get an empty array returned.

(@denist)
Joined: 11 months ago

Posts: 0

fine! now you can ask dependents of first item of this array:Controller:Float_Wire

it has to show you some morpher controller… maybe the name of controller will say you a slot. or you can search it going throuпh all slots.

(@mackinder)
Joined: 11 months ago

Posts: 0

Okay so…

refs.dependents $.pos.controller.Y_Position.controller [#Limited_Controller__Bezier_Float].controller

Which returns:

#(Controller:Float_Wire, ReferenceTarget:ParamBlock, Morpher:Morpher, ReferenceTarget:ModApp, ReferenceTarget:DerivedObject, $PolyMesh:Teapot001 @ [-57.893250,0.000000,0.000000], Controller:Float_Limit, Controller:Position_XYZ, Controller:Position_Rotation_Scale, $Circle:JoystickNameCircleController @ [0.000000,0.000000,0.000000], ReferenceTarget:NodeSelection, ReferenceTarget:ReferenceTarget)

So then I store that result in an array with:

testArray = refs.dependents $.pos.controller.Y_Position.controller[#Limited_Controller__Bezier_Float].controller

Refs.dependents testArray[1] results in:

#(ReferenceTarget:ParamBlock, Morpher:Morpher, ReferenceTarget:ModApp, ReferenceTarget:DerivedObject, $PolyMesh:Teapot001 @ [-57.893250,0.000000,0.000000])

Am I going about this the wrong way? I feel like I’m missing something here. Sorry for not grasping this better, I’m really grateful for your help.

after you have Float_Wire controller (it’s testArray[1]) you can get its slave controller:


slave = testArray[1].slaveAnimation

4 Replies
(@mackinder)
Joined: 11 months ago

Posts: 0

Hey man, cheers for continuing to help me. After asking for the slaveAnimation I’m given the result of “Controller:Bezier_Float”?

(@denist)
Joined: 11 months ago

Posts: 0

there is some misunderstanding. i don’t see any block. everything is obvious.
here is how i see the picture:
#you have master wire controller
#you want to know what the master controls
#you can get slave controller

why is it not simple to run through all mopher’s slot controllers to get the searched one?

(@mackinder)
Joined: 11 months ago

Posts: 0

Oh I see! I was expecting to see a direct result from the controller itself, I didn’t realise I was finding something to match. D’oh!

I don’t have Max in front of me now, but I presume I’d run code that checks it something along the lines of:

if refs.dependson myObject.morpher[1].controller == slave then print "YES" else "NO"

Cheers man.

(@mackinder)
Joined: 11 months ago

Posts: 0

Hey man, I got a chance to get back to this and this works a charm.

Working back from the slave I’ve found using ref.dependents I can then find the mesh it’s working with.

Which is perfect.

Thanks again man!

:bowdown:

Page 2 / 2