Notifications
Clear all

[Closed] Representing a CAT rig as a traditional bone hierarchy

Does anyone have any ideas how you’d represent a CAT rig as a traditional bone hierarchy? I’m doing some updates to my game exporter and am trying to add support for CAT rigs… but it has been a total nightmare for me.

I need to be able to represent the rig as if it was rigged with standard bones so that I can export the rig where each bone references a parent bone and the exported transformation for each bone is in parent space.

Any ideas? Resources? Cyanide pills?

6 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

it’s doable only if you are OK to export rig’s animation with key per frame (baked). in general case there is no way to convert CAT rig to bones because of specific CAT controllers behavior.

That is fine. I’m exporting to the Source Engine and the animations are keys per frame anyway.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

well. the hierarchy convert might be:


fn convertCATSkeleton catRoot showlinks:on = 
(
	bones = #()
	catBones = join #() catRoot
	for node in catBones do
	(
		b = point name:("Bone_" + node.name) transform:node.transform wirecolor:node.wirecolor 
		if (k = finditem catBones node.parent) != 0 do b.parent = bones[k]
		append bones b
	)
	bones.showLinks = bones.showLinksOnly = showlinks
	bones
)

here is how you can transfer animation:


fn transferCATAnimation catRoot boneRoot range: = 
(
	if not iskindof range interval do range = animationrange
		
	catBones = join #() catRoot
	bones = join #() boneRoot
	with animate on for t = range.start to range.end do at time t 
	(
		for k=1 to catBones.count do bones[k].transform = catBones[k].transform
	)
)

Denis … you are a godsend to my sanity. Thank you again and again. Such a simple solution to something my brain was convoluting into chaos! You are a God amongst mortals. I shall use this with great delight (and cancel my order for a bottle of cyanide pills).

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

keep cyanide pills for other case