Hi, I just received this question and it would be great if you could help me with it:
I'm iterating through all the channels in the document. Is there any way to check whether a channel is a camera channel or not?
Thank you very much!
Check when a channel is from the camera?
Moderators: Víctor Paredes, Belgarath, slowtiger
- Víctor Paredes
- Site Admin
- Posts: 5660
- Joined: Wed Jan 26, 2005 12:18 am
- Location: Barcelona/Chile
- Contact:
Check when a channel is from the camera?
Moho Product Manager
www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
- synthsin75
- Posts: 9972
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Check when a channel is from the camera?
Code: Select all
local chanCnt = moho.layer:CountChannels()-1
local ch = MOHO.MohoLayerChannel:new_local()
for i=0, chanCnt do
moho.layer:GetChannelInfo(i, ch)
if (string.match(ch.name:Buffer(), "(Camera).+")) then
print(ch.name:Buffer())
end
end
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- hayasidist
- Posts: 3519
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Check when a channel is from the camera?
or check channelID for one of the global constants
CHANNEL_CAMERA_PANTILT
CHANNEL_CAMERA_ROLL
CHANNEL_CAMERA_TRACK
CHANNEL_CAMERA_ZOOM
e.g.
CHANNEL_CAMERA_PANTILT
CHANNEL_CAMERA_ROLL
CHANNEL_CAMERA_TRACK
CHANNEL_CAMERA_ZOOM
e.g.
Code: Select all
for i = 0, numCh - 1 do
local chInfo = MOHO.MohoLayerChannel:new_local()
moho.layer:GetChannelInfo(i, chInfo)
if chInfo.channelID == CHANNEL_CAMERA_ROLL then ...
- Víctor Paredes
- Site Admin
- Posts: 5660
- Joined: Wed Jan 26, 2005 12:18 am
- Location: Barcelona/Chile
- Contact:
Re: Check when a channel is from the camera?
Thank you very very much to both! (again!)
I think this is what we were looking for.
I think this is what we were looking for.
Moho Product Manager
www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel