An "Always Visible" option for Sub-Switch Layers?
Moderators: Víctor Paredes, Belgarath, slowtiger
An "Always Visible" option for Sub-Switch Layers?
Well, hello... This is my first Poll and I'm a little nervous... ejem! I always have need a feature like this when I'm working with Switch Layers and I'd want to know if this could be usefull for someone more... The thing is very simple, an option that let you maintain always visible the sub-layer that you want inside a certain Switch Layer group, for an unlimited animation during morphings, lipsinc, and other animation compatibilities, for example: you could maintain always visible the layer called "Head", or "Eyes" and Switch bettween mouths layers AI, O, E, U, etc... for perfect lipsincing with the automatic interaction of the mouths (and bones movement) over entire head and eyes, and with the possiblity of made the character blink (i.e) meatime talks, working only over layer called "Eyes" (not over all the eyes in all Sub-Layers...), hmmm I don't know, but I think all can be better explain (hope) in this old post where I discuss this with... (drrrr-ums) THE GUEST STAR 7feet!!! http://www.lostmarble.com/forum/viewtop ... =2709#2709 ...ENJOY IT!
Uf... What a SUCCES in my first time!!! ...SORRY for have insisted! Now I understand that maybe this is a very peculiar Feature Request and nobody really need it (althought I go on thinking that something like this would IMPROBE enormously the versatility of Switch Layes), but well... Now here is my new proporsal: ...Like seems that this only affects to me is logic think on search about an individual solution by (i.e) Embedded Scripting... could somebody (LM, 7feet, myles, rylleman, or any... PLEASE) tell me if something like this could be possible apply some code to a certain Sub-layer of the Switch group by Embedded Script? You know, to get this sub-layer remain visible all the time... Or maybe apply it directly in Switch layer adding to the code the names of the sub-layers that must be "always visible"? I think this must be impossible ...but talking about Embedded Scripts I'm not sure if could be a secret way and, Well... I'd only want to be sure... You can't imaginate it, but this is a VERY important thing to me and I'd be SO gratefull if somebody could tell me if can be possible or give me any clue... Only that... uf... THANKS!!!
Jaja... YES! I'm very surprised too! I'm wondering if I will not have some "enemies" in the forum (I mean, apart from cribble and LM, of course )
PS: cribble + LM = 2 hmmm...
PS: cribble + LM = 2 hmmm...
Last edited by Rai López on Thu Sep 29, 2005 8:39 pm, edited 1 time in total.
Well, here I am again, always thinking... This idea is not new to me, but another possibility to solve any kind of Switch Layer limitations it'd be can do "Lipsinc with Actions" ...I mean, a script with the skill to read *.dat files and insert a Copy/Referenced Action called AI, O, E, U, etc... at the specified frame in the Timeline... I think this could be VERY usefull and UNlimited feature to get all that you want during Lipsinc and maybe another uses... I've been "investigating" and the more similar script to get this that I've found is this "ImportDAT" script writed by 7feet:
...It seems that could be "easy" modify it to get insert an Action instead a Switch Value and cause of this I've put it here, but it's a 7feet script and I'll delete it if he wants... Well, there is no examples about how can I insert an Action by script and I'm very lost... again, if somebody has any clues or is interested in something like this and have any idea of scripting works, I'd be VERY gratefull for any HELP, as I've said before this is a very important issue to me (and hope to others) ...THANKS!!!
Code: Select all
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************
ScriptName = "SF_ImportDat"
-- **************************************************
-- General information about this script
-- **************************************************
SF_ImportDat = {}
function SF_ImportDat:Name()
return "ImportDAT"
end
function SF_ImportDat:Version()
return "1.01"
end
function SF_ImportDat:Description()
return "Import .DAT switch data at current frame"
end
function SF_ImportDat:Creator()
return "Brian Quinn (C) 2005"
end
function SF_ImportDat:UILabel()
return("ImportDAT")
end
--Copyright 2005 Brian Quinn
--released under the Gnu Public License (www.gnu.org)
--all applicable rights reserved.
--updated 8:04pm EDT 4/16/2005
--Thanks to Mike Clifton and Lost Marble. You rock.
-- **************************************************
-- The guts of this script
-- **************************************************
function SF_ImportDat:IsEnabled(moho)
if (moho.layer:LayerType() ~= MOHO.LT_SWITCH) then
return false
end
return true
end
function SF_ImportDat:Run(moho)
local path = LM.GUI.OpenFile("Select .DAT File")
if (path == "") then
return
end
local DATfile = io.open(path, "r")
if (DATfile == nil) then
LM.GUI.Alert(LM.GUI.ALERT_WARNING, "Can't open file", nil, nil, "OK", nil, nil)
return
end
local DATline = ""
DATline = DATfile:read("*line")
if DATline ~= "MohoSwitch1" then
LM.GUI.Alert(LM.GUI.ALERT_WARNING, "Not a proper Switch Data file!", nil, nil, "EXIT", nil, nil)
return
end
local sLayer = moho.layer
local done = false
curFrame = moho.frame
while not done do
DATframe = DATfile:read("*number")
if DATframe then
DATline = DATfile:read("*line")
local stripped = false
while not stripped do
local maybeSpace = string.sub(DATline, 1,1)
if maybeSpace == " " then
DATline = string.sub(DATline, 2)
else
stripped = true
end
end
sLayer:SetValue(DATframe + curFrame, DATline)
print (DATframe + curFrame, DATline, string.len(DATline))
else
done = true
end
end
end
AAARRRGGGhhh... I've been looking in Moho Scripting Documentation and seems that the codes to insert a Switch value are the same that the codes to insert an Action... Well, knowing it, where before had this:
I have put this:
But when I run the script I get this message in Lua Console:
...rograma\Moho\scripts\menu\Other\RL_insert_action.lua:76:error in function 'InsertAction'. argument #3 is 'string'; 'number' expected.
And I don't know WHY! Or what it means! Somebody can helpme with this??? It Seems very "easy" but I can't get it, if you have some idea of scripting, maybe you can see it in seconds, and I'd need an entire life... PLEASE if you have any info or clue I'm all ears, and as I've said I'll be very (VERY) grateful! REALLY! Uf... CIAO!
Code: Select all
sLayer:SetValue(DATframe + curFrame, DATline)
Code: Select all
sLayer:InsertAction(DATframe + curFrame, DATline)
...rograma\Moho\scripts\menu\Other\RL_insert_action.lua:76:error in function 'InsertAction'. argument #3 is 'string'; 'number' expected.
And I don't know WHY! Or what it means! Somebody can helpme with this??? It Seems very "easy" but I can't get it, if you have some idea of scripting, maybe you can see it in seconds, and I'd need an entire life... PLEASE if you have any info or clue I'm all ears, and as I've said I'll be very (VERY) grateful! REALLY! Uf... CIAO!