Parenting changes?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Parenting changes?

Post by mkelley »

Sorry, again, for these questions about things that USED to work and now no longer work (in this case, at all) but I can't get a bone to reparent anymore.

This used to work just fine:

bone.fParent = parentID

assuming I have a child bone as "bone" and the ID of the parent I want to assign (gotten from a simple skel:CountBones() until the bone:Name() matches the name I'm looking for). Now it doesn't seem to do a thing, having no assignment at all for those bones I am trying to parent (the same script works fine in AS 9).

I assume that's because something major changed in the way bone parents work but, again (sigh) I can find no documentation anywhere that explains this. Can anyone point me in the right direction?
User avatar
synthsin75
Posts: 9968
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Parenting changes?

Post by synthsin75 »

I tried looking at the Lua pkg files for this, but half of them are not even formatted for readability. No line breaks at all.
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Parenting changes?

Post by dkwroot »

It looks like you need to use both:

bone.fParent = parentID
bone.fAnimParent:SetValue(parentFrame, parentID)

This is probably because we can animate parenting now.
Last edited by dkwroot on Mon Jul 06, 2015 5:09 pm, edited 1 time in total.
User avatar
mkelley
Posts: 1647
Joined: Fri Nov 02, 2007 5:29 pm
Location: Sunny Florida
Contact:

Re: Parenting changes?

Post by mkelley »

Yep, that was it. Thanks!

(I spent hours trying to figure out what was going on -- forgot all about animating parents).
Post Reply