Search found 107 matches

by lehtiniemi
Wed Mar 23, 2016 9:28 pm
Forum: Scripting
Topic: Problem with GroupLayer and CountLayers()
Replies: 2
Views: 1686

Re: Problem with GroupLayer and CountLayers()

synthsin75 wrote:You need to cast the layer as a group type first.

local group = moho:LayerAsGroup(layer)

group:Countlayers()

Thank you!!!!
by lehtiniemi
Wed Mar 23, 2016 7:02 pm
Forum: Scripting
Topic: Problem with GroupLayer and CountLayers()
Replies: 2
Views: 1686

Problem with GroupLayer and CountLayers()

I'm trying to go through all layers in the document, but in the code below, after detecting a IsGroupType() and trying to read the layer count, I get "attempt to call method 'CountLayers' (a nil value). What am I doing wrong here? I have three layers in my document: A group layer, a bone layer ...
by lehtiniemi
Wed Mar 23, 2016 4:18 pm
Forum: Scripting
Topic: Two scripts for you: "Maintain pose" and "Toggle visibility"
Replies: 24
Views: 8059

Re: Two scripts for you: "Maintain pose" and "Toggle visibil

I can't get this to work. Despite what I give as pos/neg, it always returns the closest previous key, never the next. I can't control the direction... What could it be?
by lehtiniemi
Wed Mar 23, 2016 11:45 am
Forum: Scripting
Topic: Actions timeline and normal timeline?
Replies: 4
Views: 2196

Re: Actions timeline and normal timeline?

EDIT: Thanks! :)
by lehtiniemi
Tue Mar 22, 2016 9:58 pm
Forum: Scripting
Topic: Copying/moving keyframes within the same layer channel?
Replies: 17
Views: 5691

Re: Copying/moving keyframes within the same layer channel?

You can see all the channels and their subchannels by running Scripts>Script Writing>List Channels. Point motion has no subchannels. Selected point motion is its own channel. sorry to disagree Wes- but point motion does have subchannels (and selected point motion has subchannels if more than one po...
by lehtiniemi
Tue Mar 22, 2016 9:39 pm
Forum: Scripting
Topic: Copying/moving keyframes within the same layer channel?
Replies: 17
Views: 5691

Re: Copying/moving keyframes within the same layer channel?

Uh, I haven't used them, but shouldn't these be all you need? void CopyFrame(int32 fromFrame, int32 toFrame, bool recursive); void DeleteFrame(int32 frame, bool recursive); EDIT: Oh right, it keys all channels and doesn't preserve interpolation. Yea I was really excited when I found those but it's ...
by lehtiniemi
Tue Mar 22, 2016 5:25 pm
Forum: Scripting
Topic: Copying/moving keyframes within the same layer channel?
Replies: 17
Views: 5691

Re: Copying/moving keyframes within the same layer channel?

Just one quick clarification from the top of my head: what are subchannels? Is it like if there's channel "Perspective shadow", then subchannel would be "shadow scale", "shadow sheer" etc?
by lehtiniemi
Tue Mar 22, 2016 5:02 pm
Forum: Scripting
Topic: Actions timeline and normal timeline?
Replies: 4
Views: 2196

Actions timeline and normal timeline?

How do you manipulate action timeline? I mean, what's the structure? There seems to be function ActivateAction (or something like that) that "activates action timeline for editing". What does this mean? Let's say I activate action for a bone layer. Does every keyframe I add to any layer un...
by lehtiniemi
Tue Mar 22, 2016 4:59 pm
Forum: Scripting
Topic: Copying/moving keyframes within the same layer channel?
Replies: 17
Views: 5691

Re: Copying/moving keyframes within the same layer channel?

Wow, thanks for a through answer!!! I'll dig into this. :)
by lehtiniemi
Tue Mar 22, 2016 2:13 am
Forum: Scripting
Topic: Copying/moving keyframes within the same layer channel?
Replies: 17
Views: 5691

Re: Copying/moving keyframes within the same layer channel?

I'm trying to shift all the animation in the whole document and trying to find a good way to do this. Some issues: Looping through all layers: -moho.document has CountLayers and Layer-function that gives me all the TOP-LEVEL layers. How do I access group layers and layers contained by bone layers? Y...
by lehtiniemi
Tue Mar 22, 2016 1:18 am
Forum: Scripting
Topic: Script for lip sync I'm working on
Replies: 52
Views: 29612

Re: Script for lip sync I'm working on

Here's the map. It's listed in the readme. It's kept in "phonemes" in the utility directory. msPhonemes.phonemeMap = { a = { "AI", "v" }, b = { "MBP", "c" }, c = { "etc", "c" }, d = { "etc", "c" }, e = { "...
by lehtiniemi
Mon Mar 21, 2016 10:52 pm
Forum: Scripting
Topic: Coordinates of the tip of the bone
Replies: 20
Views: 5053

Re: Coordinates of the tip of the bone

sorry - I can't make it work. It's close but ... I took your routine and hardwired a call to it Print ("Bone", bone:Name(), "Base x, y", bone.fPos.x, bone.fPos.y, "angle/length/scale", bone.fAngle, bone.fLength, bone.fScale) -- confirms correct bone vec = CalculateBone...
by lehtiniemi
Mon Mar 21, 2016 10:16 pm
Forum: Scripting
Topic: Script for lip sync I'm working on
Replies: 52
Views: 29612

Re: Script for lip sync I'm working on

Looking forward to! Also if you ever get time, please consider the idea I wrote some messages ago about some help for filling long vowels. In a nutshell, if there's vowel A that is over X frames long so that it would simply appear to be "still", especially when using switch frames, then th...
by lehtiniemi
Mon Mar 21, 2016 7:40 pm
Forum: Scripting
Topic: Coordinates of the tip of the bone
Replies: 20
Views: 5053

Re: Coordinates of the tip of the bone

That sounded so simple and straightforward - so I gave it a go ... but I'm getting different results from the "longhand" (seems to be right) and your shorter approach (can't get it to give the right answer!?) vec:Set(bone.fPos) bone.fMovedMatrix:Transform(vec) print (vec.x, vec.y) -- not ...
by lehtiniemi
Mon Mar 21, 2016 5:04 pm
Forum: Scripting
Topic: Coordinates of the tip of the bone
Replies: 20
Views: 5053

Re: Coordinates of the tip of the bone

Oh, I came up way the most simple way to calculate this! Basing on that you can get the transformation effect of the whole parent skeleton to the current bone by transforming the current bone with fMovedMatrix of the parent bone, you can think like this: the tip of the current bone is basically the ...