Is it okay for me to write a layer script specific to a certain type of file?
For instance, in my face rig I have some scripting functionality that works perfectly with a lot less code than if I made it work for ANY other file or situation.
By writing a script that works just for this one rig set up would be less effort. I know for a fact exactly which bones are there and exactly which properties to change. In order to CHECK for all those things in ANY file makes it much more work.
Is this just lazy or is it a proper solution? It seems logical to me but I could be wrong.
-vern
Layer script written exclusively for one bone rig?
Moderators: Víctor Paredes, Belgarath, slowtiger
Well, it's just as with animation. The short-cut with corrections afterwards is often longer than longer preparation and less corrections afterwards. If you need to do a lot of script writing for each animation you do, it is worth to generalize your script, so you don't have to rewrite your script so often.
Just to clarify...
This rig would be used for ALL my characters from now on. Of course I may change or update it as needed but the bones would stay the same for every file it is used in.
The same script would be used for anything set up with this rig. The script would not have to change for different files and would work the same for all characters or files that use the rig it was designed for.
I see your point though, and I should spend the time to make the script universal. Another issue is speed and efficiency of the script. By defining exact parameters to target I don't have to search the (HUGE GIGANTIC) bone list at all. I could cut down on the amount of itteration using "if then" since I know up front what is there. I just call the exact precise bone IDs (new bones would not effect the internal AS bone ID list.)
If the AS file doesn't use the rig those bones won't be there so the script would be useless anyway. It would be a "one trick pony" for my rig.
I am kind of warming to this idea. It sure would streamline the scripting necessary. It would also cut the size of a script by a tremendous amount. Bug testing would be much easier.
I am planning on targeting specific bones and properties to aid in the pseudo 3D turn effect. Any vector drawn "face" or "head" could still be adapted to the bone rig. Since the head bone layer would be independent of the rest of the body (a separate sub bone layer bound to a head bone in the main skeleton) other layer scripts could be used in the body bone layer.
-vern
This rig would be used for ALL my characters from now on. Of course I may change or update it as needed but the bones would stay the same for every file it is used in.
The same script would be used for anything set up with this rig. The script would not have to change for different files and would work the same for all characters or files that use the rig it was designed for.
I see your point though, and I should spend the time to make the script universal. Another issue is speed and efficiency of the script. By defining exact parameters to target I don't have to search the (HUGE GIGANTIC) bone list at all. I could cut down on the amount of itteration using "if then" since I know up front what is there. I just call the exact precise bone IDs (new bones would not effect the internal AS bone ID list.)
If the AS file doesn't use the rig those bones won't be there so the script would be useless anyway. It would be a "one trick pony" for my rig.
I am kind of warming to this idea. It sure would streamline the scripting necessary. It would also cut the size of a script by a tremendous amount. Bug testing would be much easier.
I am planning on targeting specific bones and properties to aid in the pseudo 3D turn effect. Any vector drawn "face" or "head" could still be adapted to the bone rig. Since the head bone layer would be independent of the rest of the body (a separate sub bone layer bound to a head bone in the main skeleton) other layer scripts could be used in the body bone layer.
-vern
Of course, you should not make your script more general for the sake of it, only if it would save you time in the future. It is up to developers to go all the way and make it as useful as possible to anyone whoever would use the script.
I only wanted to warn you not to fall into the trap to base your animation on the limits of your script. If your script limits your creativity, either rewrite it, or find another way than scripting to solve it.
Don't adjust your method of animating to your script, is what I meant to write.
OTOH, a script shouldn't impose a particular workflow on the user. It should be flexible and robust enough to handle all kinds of outrageous things it gets to deal with, and still give predictable results.
I only wanted to warn you not to fall into the trap to base your animation on the limits of your script. If your script limits your creativity, either rewrite it, or find another way than scripting to solve it.
Don't adjust your method of animating to your script, is what I meant to write.
OTOH, a script shouldn't impose a particular workflow on the user. It should be flexible and robust enough to handle all kinds of outrageous things it gets to deal with, and still give predictable results.