ahlekoofe / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

applyChannelTransform not work on manually controlled bone #279

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Make a gkBone manually controlled
2.Apply a new transform
3.

What is the expected output? What do you see instead?
The expected output is that the bone should respect the new Transform State.
The bone does not not do anything.

What version of the product are you using? On what operating system?
r1201

Please provide any additional information below.
Windows 7 Professional 64 bit
Visual Studio 2010 Ultimate

The problem is applyChannelTransform ignore the transform state for manually 
controlled bone. It should respect any input transform state whether the bone 
is manually controlled or not.

The patch correct issue.

Thanks for the help.

Original issue reported on code.google.com by KAI.TING...@gmail.com on 9 Oct 2012 at 11:05

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by thomas.t...@googlemail.com on 9 Oct 2012 at 11:20

GoogleCodeExporter commented 8 years ago
This patch adds a lua frontend for apply channel transform. The patch also 
fixes the problem that set bone to manual in lua will crash the Runtime demo.

The crash problem comes from
                gkEntity* ent = static_cast<gkEntity*>(m_object);
        gkSkeleton* skel = ent->getSkeleton();
should just be 
        gkSkeleton* skel = static_cast<gkSkeleton*>(m_object);
Since the m_object itself should be a skeleton instead of an entity

Apply bone channel transform
- Set the bone transform at default transform
    skeleton:applyBoneChannelTransform("BoneName")
- Set the bone transform with specify location, orientation
    skeleton:applyBoneChannelTransform("BoneName", loc-vec)
- Set the bone transform with specify location, rotation
    skeleton:applyBoneChannelTransform("BoneName", loc-vec, rotation-vec) 
- Set the bone transform with specify location, rotation, scale
    skeleton:applyBoneChannelTransform("BoneName", loc-vec, rotation-vec, scale-vec)    
- Set the bone transform with specify location, rotation, scale, weight
    skeleton:applyBoneChannelTransform("BoneName", loc-vec, rotation-vec, scale-vec, weight-sca)

Press K to enable left shoulder as a manual controlled bone
Press J to disable left shoulder as a non manual control bone
Press I to put shoulder up when it is a manually controlled bone
Press M to put shoulder down when it is a manually controlled bone

I also attach an example blend that shows this by modifying the bone - 
parenting sample.

Hope it helps.

Sincerely,
Danil

Original comment by KAI.TING...@gmail.com on 20 Oct 2012 at 3:02

Attachments:

GoogleCodeExporter commented 8 years ago
Danil, thx for this great patch and the cool test-case for the regression test.
Sry, it took me a bit to apply the patch!

http://code.google.com/p/gamekit/source/detail?r=1203

Original comment by thomas.t...@googlemail.com on 25 Oct 2012 at 7:18

GoogleCodeExporter commented 8 years ago
To Thomas,

Thanks for the commit.

Sincerely,
Danil

Original comment by KAI.TING...@gmail.com on 26 Oct 2012 at 5:05