Vitruvian bones and IK?

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
SimplSam
Posts: 1218
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Vitruvian bones and IK?

Post by SimplSam »

How do people cope with Vitruvian bones and IK?

I have IK working as desired with a simple arm rig, but when I introduce the 2nd lower vitruvian limb bone it kills IK on the upper limb. This is normal / expected for normal bone structures, but I was hoping Vitruvian Bones would permit IK with multiple lower limbs due to the fact that only one limb bone is active at any time.

At the moment the solution might involve a bunch of reparenting. But keen to see if I missed a trick ...
Last edited by SimplSam on Sat Jul 09, 2022 12:57 am, edited 3 times in total.
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Virtruvian bones and FK?

Post by Greenlaw »

Hmm...can you share an example?

FWIW, FK with Vitruvian Bones works here. With the Manipulate Bones tool selected, I just hold Alt and use FK on any bone inside the V-Bones group as normal. Then Alt-C or -D to change V-Bones groups, and press Alt to use FK in this group. So far I haven't had a problem with that.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Virtruvian bones and FK?

Post by Greenlaw »

Or did you mean IK? IK should work too but if you have another bone branching out from a bone, IK will terminate there.

So if you have parented another bone to the upper arm bone besides the lower arm bone, that could disable IK for the upper arm bone. To work around this, select the other bone and enable Ignored by Inverse Kinematics (in Constraints) for that bone. This should allow IK to be active on the upper arm bone. (In my rigs, I need to do this for a hidden the elbow bone.)

Hope this helps.
User avatar
SimplSam
Posts: 1218
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Vitruvian bones and IK?

Post by SimplSam »

Ha. I have updated the subject to "IK" !!!

And the issue is where we have multiple Vitruvian limbs on the same upper bone.

So... "Ignored by Inverse Kinematics" works as you have indicated, but it is not keyframable/animatable. Therefore - I can only ever have one of the Vitruvian child limbs controlling the IK.

I have disabled Vitruvian below to show both bones, but "Arm lo 1", and "Arm lo 2" are in a Vitruvian group and each needs to be IK controlling "Arm up" - when they are active (respectively).

Image
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Vitruvian bones and IK?

Post by synthsin75 »

Quick edit to the IsEnabled function will automatically allow IK for only the active Vitruvian groups:

Code: Select all

function LM_BoneGroups:IsEnabled(moho)
	local skel = moho:Skeleton()
--syn\/
	--automatically enable IK for active Vitruvian group
	for i=0, skel:CountBones()-1 do
		if (skel:Bone(i):IsGroupVisible()) then
			skel:Bone(i).fIgnoredByIK = false
		else
			skel:Bone(i).fIgnoredByIK = true
		end
	end
--syn/\
	if (skel == nil) then
		if (self:ShouldUseParentSkeleton(moho)) then
			skel = moho:ParentSkeleton()
		end
		if (skel == nil) then
			return false
		end
	end
	if (skel:CountBones() < 1) then
		return false
	end
	return true
end
Daxel
Posts: 1088
Joined: Wed Mar 27, 2019 8:34 pm

Re: Vitruvian bones and IK?

Post by Daxel »

I didn't notice this VB limitation. Greenlaw's explanation makes a lot of sense. And that fix from Wes was the fastest of the west. Even if this is the expected behaviour for a hidden bone, it is inconvenient with V bones. I hope they implement that improvement on the next version. I'm still hyped about VB's potential even if I have only used them once so far.
User avatar
SimplSam
Posts: 1218
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Vitruvian bones and IK?

Post by SimplSam »

Wow! That was quick indeed.

Working like a charm!

Thanks all
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Vitruvian bones and IK?

Post by Greenlaw »

Hmm...I guess I hadn't noticed because I normally use FK when animating arms. But of course I do need IK for arms when I pin the hands to something (hips, table, etc.,) so this is good to know. Thanks for creating a patch Wes, and so quickly too! I'll give it a try tonight.
User avatar
lucasfranca
Posts: 181
Joined: Sat Oct 07, 2017 11:47 pm

Re: Vitruvian bones and IK?

Post by lucasfranca »

synthsin75 wrote: Sat Jul 09, 2022 12:19 am Quick edit to the IsEnabled function will automatically allow IK for only the active Vitruvian groups:

Code: Select all

function LM_BoneGroups:IsEnabled(moho)
	local skel = moho:Skeleton()
--syn\/
	--automatically enable IK for active Vitruvian group
	for i=0, skel:CountBones()-1 do
		if (skel:Bone(i):IsGroupVisible()) then
			skel:Bone(i).fIgnoredByIK = false
		else
			skel:Bone(i).fIgnoredByIK = true
		end
	end
--syn/\
	if (skel == nil) then
		if (self:ShouldUseParentSkeleton(moho)) then
			skel = moho:ParentSkeleton()
		end
		if (skel == nil) then
			return false
		end
	end
	if (skel:CountBones() < 1) then
		return false
	end
	return true
end
Wow, really good! Does this work for common bone structure too?
An old guy [since 1983] who was raised in front of the TV.
Passionate about animation, after getting old, he decides to make it his hobby.

I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.

https://youtube.com/animai2D
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Vitruvian bones and IK?

Post by synthsin75 »

lucasfranca wrote: Sat Jul 09, 2022 11:56 am Wow, really good! Does this work for common bone structure too?
With another quick edit, yes, it can work with any selected bone too:

Code: Select all

function LM_BoneGroups:IsEnabled(moho)
	local skel = moho:Skeleton()
--syn\/
	--automatically enable IK for any selected bone
	local sel = skel:SelectedBoneID()
	for i=0, skel:CountBones()-1 do
		if (skel:Bone(i).fSelected or skel:IsBoneChild(i, sel)) then
			skel:Bone(i).fIgnoredByIK = false
		else
			skel:Bone(i).fIgnoredByIK = true
		end
	end
--syn/\
	if (skel == nil) then
		if (self:ShouldUseParentSkeleton(moho)) then
			skel = moho:ParentSkeleton()
		end
		if (skel == nil) then
			return false
		end
	end
	if (skel:CountBones() < 1) then
		return false
	end
	return true
end
User avatar
lucasfranca
Posts: 181
Joined: Sat Oct 07, 2017 11:47 pm

Re: Vitruvian bones and IK?

Post by lucasfranca »

synthsin75 wrote: Sat Jul 09, 2022 8:15 pm
lucasfranca wrote: Sat Jul 09, 2022 11:56 am Wow, really good! Does this work for common bone structure too?
With another quick edit, yes, it can work with any selected bone too:

Code: Select all

function LM_BoneGroups:IsEnabled(moho)
	local skel = moho:Skeleton()
--syn\/
	--automatically enable IK for any selected bone
	local sel = skel:SelectedBoneID()
	for i=0, skel:CountBones()-1 do
		if (skel:Bone(i).fSelected or skel:IsBoneChild(i, sel)) then
			skel:Bone(i).fIgnoredByIK = false
		else
			skel:Bone(i).fIgnoredByIK = true
		end
	end
--syn/\
	if (skel == nil) then
		if (self:ShouldUseParentSkeleton(moho)) then
			skel = moho:ParentSkeleton()
		end
		if (skel == nil) then
			return false
		end
	end
	if (skel:CountBones() < 1) then
		return false
	end
	return true
end
Forgive me for my ignorance, but where do I put this code? Would it be in .LUA file? If yes, which one? Or is it a Layer type script?
An old guy [since 1983] who was raised in front of the TV.
Passionate about animation, after getting old, he decides to make it his hobby.

I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.

https://youtube.com/animai2D
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Vitruvian bones and IK?

Post by synthsin75 »

This replaces the IsEnabled function of the Vitruvian bone tool...which is called lm_bone_groups.lua.

I would suggest copying it, and its pngs, to your custom content folder and editing it there. Don't edit the stock scripts in the installation folder.
Post Reply