[Closed] adding controller to weight track wont work
Hey guys. Lets say i have a object with a list controller on the X_position track. Now i want to add a bezier_float to the weight track of the same position list. When i do it manually the listener gives me that line:
$.pos.controller.X_Position.controller.weight.controller = bezier_float ()
But if i repeat that same command in the listener he confirms a Controller:Bezier_Float, but nothing happend. The weight track will remain empty.
Please help.
and while i’m at it, here’s another question.
Is it possible to disable the evaluation in the listener?
I’m asking because my code contains a string with 200 lines of maxscript. Now everytime i evaluate the code he goes through and evaluates the same string 200 times wich takes a lot of time.
txt = “maxscript”
txt += “maxscript”
txt += “maxscript”
…and so on
Ok, weight track mistery solved. Weight is a float array so i put .weight[1] at the end it worked.
The macro recorder can be confusing sometimes
Anyway, i’m still looking for an answer to my second question. Is there a way to turn off the listener confirmations while evaluating a script?
If there’s an error in the code it will always output to the listener, even if you turn the listener “off”. You could regulate the error messages by adopting a better debug scheme, with try catch/throw and assert.
Bottomline no you can’t disable this sort of data making it into the listener, but if you develop a better debugging approach you’d also have more meaningful feedback from the script. (please note I also talk to myself here ;))
-Johan
Hey Johan,
It’s not the error messages that bother me, like i said before it is that the same string get evaluated 200 times (for 200 lines of code) wich will take awful long to evaluate. In my case i have a string with a CA definition wich get applied to an empty modifier. It seems that instead of evaluating the string line for line he evaluates the complete string over and over again. for example:
Txt ="first line of code"
Txt += "second line of code"
Txt += "third line of code"
will result in :
"first line of code
"
"first line of code
second line of code
"
"first line of code
second line of code
third line of code
"
If your string is 200 lines long, this could take a while. But you said something about turning the listener “off”. How can i do that via maxscript?
If I remember correctly, stringstream may be more efficient at concatenation … but your issue with the echo to listener is probably scope related.
Try putting your txt= “whatever”; txt+=”morewhatever’;etc. enclosed in brackets.
(
txt = "whatever"
txt += "more wahtever"
)
Does it still echo to the listener?