"add keyframe" for all channel
Moderators: Víctor Paredes, Belgarath, slowtiger
"add keyframe" for all channel
hellow all! i am new here.
when i need a new key? i click "add keyframe" for each channel.
it is possible click it once for all channel, thanks for your time
when i need a new key? i click "add keyframe" for each channel.
it is possible click it once for all channel, thanks for your time
- Víctor Paredes
- Site Admin
- Posts: 5718
- Joined: Wed Jan 26, 2005 12:18 am
- Location: Barcelona/Chile
- Contact:
what about this, my super request:
viewtopic.php?t=8380
(add a keyframe of the current tool with a button)
(a button which could have a shortcut...)
could someone invert touched's script?
viewtopic.php?t=8380
(add a keyframe of the current tool with a button)
(a button which could have a shortcut...)
could someone invert touched's script?
My script was an inversion of the js_key_all script found here:
http://animatic.no-ip.com/pub/dev/moho/
Took me a while to find it again. Search wasn't showing any useful results. Google did a better job.
Maxuser managed to bring me back to the forum after an absence. The developments with DK's 3D rig sort of overwhelmed me. Now I need to catch up on what I missed.
http://animatic.no-ip.com/pub/dev/moho/
Took me a while to find it again. Search wasn't showing any useful results. Google did a better job.
Maxuser managed to bring me back to the forum after an absence. The developments with DK's 3D rig sort of overwhelmed me. Now I need to catch up on what I missed.
Are there any shapes on the layer you're trying to keyframe in your test? It can't key the shape channels without there being some shapes to key.
That being said, there are 2 or 3 channels that the script doesn't affect, and I don't know the names of the variables in Anime Studio to modify the script to affect them. But I haven't had a need to key those channels anyway.
Also, if you intend the keys to interpolate, make sure you uncheck the box that says "step mode", which is enabled by default.
That being said, there are 2 or 3 channels that the script doesn't affect, and I don't know the names of the variables in Anime Studio to modify the script to affect them. But I haven't had a need to key those channels anyway.
Also, if you intend the keys to interpolate, make sure you uncheck the box that says "step mode", which is enabled by default.
Switch layer is also one of the channels that are missing. Would love to find that for my own script.
Halvseint, animated talkshow on NRK
www.nrk.no/halvseint
www.nrk.no/halvseint
How do you think it is possible to key a switch layer? Which value will you use? The last one in the time line? Next one?. IMHO keyframe a switch layer is not possible. Keyframe the layers inside the switch layer is other story.keisern wrote:Switch layer is also one of the channels that are missing. Would love to find that for my own script.
-G
As far as I know bone dynamics don't even change when keyed. I tried before and never noticed a difference. I could be wrong.
I have tried and tried to key bone lock using a script to no avail. I believe it is "missing" from lua access in AS. I could read if it was on or off... but couldn't set it. It could be there was a different way to do it but I couldn't find it... and let me tell you... I know ALL the stuff about bones with scripting.
That was the only thing in my bone slave script that absolutely wouldn't copy from one bone to another bone.
I haven't tried scripting any of the vector properties yet.
Thanks for satisfying my curiosity.
------------
Scripting switches is tricky but easy once you get the code to do it. I wrote a script that keys a switch based on bone rotation values so you can change a switch automatically without even touching it. I rotate a bone and it cycles through the switch layers in real time... pretty cool. Different bones can control different switches.
The trick is getting all the layer names. Unlike other group type layers in AS with lua, you can only set a switch layer based on the name not the layer ID. So you have to count all the layers in the switch first as if it were a regular bone or group layer, then get the names from the layer ID then switch back to treating as a switch layer and use the name to pick which one you want to set.
It's a bit of a pain but you only have to figure it out once. I guess I should post that script for you guys. I kind of forgot about it since I don't use switches very much these days.
-vern
I have tried and tried to key bone lock using a script to no avail. I believe it is "missing" from lua access in AS. I could read if it was on or off... but couldn't set it. It could be there was a different way to do it but I couldn't find it... and let me tell you... I know ALL the stuff about bones with scripting.
That was the only thing in my bone slave script that absolutely wouldn't copy from one bone to another bone.
I haven't tried scripting any of the vector properties yet.
Thanks for satisfying my curiosity.
------------
Scripting switches is tricky but easy once you get the code to do it. I wrote a script that keys a switch based on bone rotation values so you can change a switch automatically without even touching it. I rotate a bone and it cycles through the switch layers in real time... pretty cool. Different bones can control different switches.
The trick is getting all the layer names. Unlike other group type layers in AS with lua, you can only set a switch layer based on the name not the layer ID. So you have to count all the layers in the switch first as if it were a regular bone or group layer, then get the names from the layer ID then switch back to treating as a switch layer and use the name to pick which one you want to set.
It's a bit of a pain but you only have to figure it out once. I guess I should post that script for you guys. I kind of forgot about it since I don't use switches very much these days.
-vern
I've done a script deleting/removing keyframes, that is why I need to know the switch channel name.Genete wrote:How do you think it is possible to key a switch layer? Which value will you use? The last one in the time line? Next one?. IMHO keyframe a switch layer is not possible. Keyframe the layers inside the switch layer is other story.keisern wrote:Switch layer is also one of the channels that are missing. Would love to find that for my own script.
-G
Halvseint, animated talkshow on NRK
www.nrk.no/halvseint
www.nrk.no/halvseint
My script is a work in progress. I need to make it "universal". Right now it is targeted for a specific file while I do testing. This piece of code works pretty good.
Here is a portion of the code I use to handle switches:
In this first part I am checking a bone layer for any switch layers (testlayer). If there are any I create two variables, one that treats the layer as a group (group2) and one that treats it as a switch (subSwitch). There is some other stuff in there for my rotation/switching code.
-------------------------------------
In this bit I create a local variable (swLayers) for each layer ID that is treating the switch as a group. You can't get layer ID's from a switch so I am getting the ID from it as just a "regular" group layer. That is why I created the two variables above. Each one is based on the same layer but they have different properties because they are referenced differently.
At the end is where the magic happens. After it determines the name of the switch sub layer (SWname) from the group layer ID (swLayers) it then sets a key for that switch layer using the name of the layer.
The basic concept is that a switch layer is also a group layer. Group layers have completely different properties than switch layers. Sometimes you need both so you have to change how they are referenced. The key is the code moho:LayerAsSwitch(testlayer) or moho:LayerAsGroup(testlayer).
That is how a switch layer can just be a regular old bone layer or turn into a magical switch layer.
I learned all of this right here on the forum from many people and by looking at the scripts already available.
-vern
Here is a portion of the code I use to handle switches:
In this first part I am checking a bone layer for any switch layers (testlayer). If there are any I create two variables, one that treats the layer as a group (group2) and one that treats it as a switch (subSwitch). There is some other stuff in there for my rotation/switching code.
Code: Select all
for i = 0, layerCount - 1 do
local testlayer = group:Layer(i)
if (testlayer:LayerType() == MOHO.LT_SWITCH) then
group2 = moho:LayerAsGroup(testlayer)
subSwitch = moho:LayerAsSwitch(testlayer)
Lcount = group2:CountLayers()
SWunits = 180 / Lcount
end
end
In this bit I create a local variable (swLayers) for each layer ID that is treating the switch as a group. You can't get layer ID's from a switch so I am getting the ID from it as just a "regular" group layer. That is why I created the two variables above. Each one is based on the same layer but they have different properties because they are referenced differently.
At the end is where the magic happens. After it determines the name of the switch sub layer (SWname) from the group layer ID (swLayers) it then sets a key for that switch layer using the name of the layer.
Code: Select all
for b = 1, Lcount do
local swLayers = group2:Layer(b - 1)
local swUnit = b * SWunits
local SWname = swLayers:Name()
if ( keySwitch ~= nil ) then
if (keySwitch > swUnit) then
subSwitch:SwitchValues():SetValue(moho.frame, SWname)
end
That is how a switch layer can just be a regular old bone layer or turn into a magical switch layer.
I learned all of this right here on the forum from many people and by looking at the scripts already available.
-vern