PDA

View Full Version : float controller psoitions


floatingworld
07-13-2011, 03:17 AM
What is the most efficent way to create a function that returns the position of any float controllers on a morpher modifier, then convert them to bezier? Do I compare strings or is there a better way? thanks in advance.

lo
07-13-2011, 12:06 PM
position of any float controllers? what? could you explain again?

floatingworld
07-13-2011, 12:43 PM
well if you open the curve editor, you will see a list of controllers under the morpher entry, like Morpher[1][2] etc...they are bezier by default, but if you add wiring, you create float controllers...what I want to do is to go through all the list controllers and see which are float or script or whatever, then convert them back to bezier, in order to effectively give control back to the morpher spinners and clean up all the controllers,...so one way I guess would be to use 'getName' of controller and compare this string with "float_controller" but this doesn't seem the correct way to do it, anyway I cant get it to work easily...so...am I making myself clear or...? thanks for reply

lo
07-13-2011, 01:04 PM
but if you add wiring, you create float controllers...
That is what confused me. They are all float controllers, if you add wiring you add a float_wire. You want to convert it to bezier_float.

You need to be testing the class of the controller (assuming morphMod is your morpher modifier):

for i = 1 to 100 do if morphMod[i].controller!=undefined and classOf morphMod[i].controller != bezier_float do morphMod[i].controller = bezier_float()

floatingworld
07-13-2011, 01:17 PM
fantastic lo. thanks heaps. One more thing...what if I want the location(as in Morpher[a][b][c] whatever, of the Weights on a morpher? Same sort of thing?

lo
07-13-2011, 01:31 PM
I've completely lost you again. :surprised

floatingworld
07-13-2011, 01:43 PM
ok, not making myself clear. For example, In my scene, the morpher object has ,say, a morph target at $.Morpher[3],
it has a subanim float controller at $.Morpher[3][1], and the Weights control is returned by typing in $.Morpher[3][4] in the listener.
What I want to do is locate the Weights control on the Morph modifer via a script, and also return where it was found, for eg - in $.Morpher[5][x]...where x is the location, if you like....This is so I can place the morph spinner value back to 100, so re-setting that particular morph ....is that any clearer..? thnaks again for your patience.

lo
07-13-2011, 01:58 PM
Let me see if I got this right...

You have a Float_List controller on one of the morpher channels, and you'd like to know on which channel that is, and also return it's weights array?

fn findListController morphMod =
(
local found = false
local result
for i = 1 to 100 while not found do
(
if morphMod[i].controller!=undefined and classOf morphMod[i].controller == float_list do
(
found = true
result = #(i, morphMod[i].controller.weight)
)
)
result
)

floatingworld
07-13-2011, 02:20 PM
I think that's it...you have been very helpful sir, thank you.

lo
07-13-2011, 03:32 PM
sure, glad to help

CGTalk Moderation
07-13-2011, 03:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.