Page 1 of 2

weird and annoying error message

Posted: Wed Feb 18, 2009 10:48 pm
by basshole
OKay, so, while working on walk cycles (see my other threads), I started a new project, imported some of my characters (as AS objects) into it, and worked on the walk cycles in this new project.

I used Vern's save/load bone positions script to copy the walk cycle from one of my male characters to a female. I tweaked it a little bit, and decided it was good to go. The tweaking of the keyframes for the walk cycle for the lady was in the main timeline, not in an action timeline. So, I go to take the keys from the main timeline and put them in a walk action for the lady, and I keep getting this error message every time I select/make active the walk action:

"error: creating new objects in the middle of an action can lead to unexpected results. Stop all actions and restart the script."

This is a repeatable issue, and I should note that even when I open/make active a walk action that was already existent, in my male character's bone layer, I get this error. I don't get what I'm doing that's making ASP mad at me. Is this an actual issue? Or something I can ignore. It pops up whenever I make any of the actions in any of the bone layers in this new project active/open them.

I can't acutally SEE any problems, I just keep getting the box.

On a Mac, by the way, if that's relevant.

Posted: Thu Feb 19, 2009 2:01 am
by DK
Hey basshole...I get the same message and it sucks!!! :( Vern seems to think it's to do with a recent script I may have installed. Check here for a more detailed explanation.

viewtopic.php?t=12764&highlight=error

Cheers
D.K

Posted: Thu Feb 19, 2009 3:21 am
by basshole
The tool I most recently installed was Vern's save/load bone position script

Posted: Thu Feb 19, 2009 3:54 am
by DK
Try removing it and then seeing if you get the error.
If so, find the error message in the script, comment it out and re-install it.

Cheers
D.K

Posted: Fri Feb 20, 2009 1:09 pm
by basshole
Okay, here's another weird thing. Somehow a bunch of my styles have magically been renamed.

Say I had one called "blonde hair". Now, it's "[name of bone layer] - blonde hair"

Let me guess. . .this is 'cause I imported objects/bone layers from the master project (with all my charactesr) into another to create those walk cycles, then imported them BACK into the master project from the walk cycle project and deleted the original bone layers/characters?

Oy.

Posted: Fri Feb 20, 2009 2:04 pm
by heyvern
Yes, the funky style names come from importing another AS file. It's annoying especially if you have the same styles. Now you have duplicates. I often "fix" this by using a text editor but it's a pain in the arse.

That error you get is due to a script that has an "onload" function that warns about doing stuff inside an action. It's a real pain. You have to find one of the scripts that has this code. You can delete or "comment it out" by putting:

Code: Select all

--[[

--]]
Around that section of the code.

-vern

Posted: Fri Feb 20, 2009 2:24 pm
by basshole
Thanks. I see now that by expanding the window/dialogue box that has the styles/shapes buttons and the swatches that when you open the styles, you can see the full names. Much easier to navigate.

Regarding that script, do you know WHICH scripts have that code? I have only installed a few that weren't native to ASP upon its installation. Copy flip bones, save/load bone position. . .that may be it.

Also, I don't mean to be dense, but if I found that script, what exactly do I do with it? Will it simply open in a text editor if I double click? And then do I search for that word, "onload"? And where do I put those brackets, if I find this code, exactly? Literally at the beginning and ends of those code lines, like an HTML tag? I'm not a programming guy at all. Sorry.

Posted: Fri Feb 20, 2009 3:13 pm
by heyvern
The scripts are just plain ascii text. They will open in any text editor.

Look for this code:

Code: Select all

function HV_SAVE_BONE_ANIMATION:IsEnabled(moho)
    if (moho.layer:CurrentAction() ~= "") then
       print ("Error: Creating new objects in the middle of an action can lead to unexpected results")
       print ("Stop all actions and restart the script.")
        return false 
    end
    return true
end
Comment out the print function or the whole thing:

Code: Select all

function HV_SAVE_BONE_ANIMATION:IsEnabled(moho)
    --[[
    if (moho.layer:CurrentAction() ~= "") then
       --+print ("Error: Creating new objects in the middle of an action can lead to unexpected results")
       --+print ("Stop all actions and restart the script.")
        return false 
    end
	--]]
    return true
end
-vern

Posted: Fri Feb 20, 2009 3:14 pm
by DK
From what I can understand Vern says that te scripts contain this "Error" message. If you search through your suspected scripts, find the error message and put "Comments" around it so it does not pop up.

EDIT: Darn...I was one second too slow on the Submit button there Vern :)

Cheers
D.K

Posted: Fri Feb 20, 2009 3:17 pm
by basshole
Thanks. I guess I misunderstood. . .I thought you were saying several of the scripts had that "onload" code. . .I wasn't sure if I had to search every one in the folder for it or what. I'll try this commenting out thing later.

Posted: Fri Feb 20, 2009 3:20 pm
by heyvern
Keep in mind that some of the scripts that contain that code... uh... might do weird things if you use them inside an action. I've never seen this though. In the past a ton of the scripts had this code and caused all kinds of trouble. I have been trying to to comment them out.

I might have missed it on that save bone script or some others.

-vern

Posted: Fri Feb 20, 2009 3:57 pm
by basshole
But you don't really use the save bone script "inside an action," right?

It seems like (and I tried to load it into an action tlmeline) it will only load the script to the main timeline. Then you take those keys in the main timeline and "insert copy" back into the action. That's how I was doing it, anyway.

I mean, they're just keyframes, once they're in the timeline, right? No different from any other keys? It's only while you're doing the saving/loading that the script is actually "doing something?"

Posted: Fri Feb 20, 2009 8:58 pm
by heyvern
Yes, you wouldn't use it "in" an action.

Basically the code that causes the error is a pain in the arse because tool and button scripts "run all the time". You don't have to use them in the action... they run as soon as you activate an action even if they aren't selected or used.

Here's what happened along the way...

Menu scripts DON'T run "all the time". Menu scripts may not work in an action which made that code a useful reminder. It wasn't a problem. Later on some of us discovered that a menu script can work as a BUTTON script... but now they are in the scripts tools directory and... well... then they "run all the time" causing those annoying error messages.

-vern

Posted: Fri Feb 20, 2009 9:13 pm
by basshole
I am illuminated.

FOUND IT!

It's in the "save bones" script. Load bones already has the --]]

Posted: Fri Feb 20, 2009 10:21 pm
by heyvern
So sorry about that!

I will need to fix it and upload a new version.


-vern