Skip to content

Commit c251c6a

Browse files
committed
update sample to new importer and remove fabrik
1 parent 0e39139 commit c251c6a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

samples/actor.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from panda3d.core import load_prc_file_data, NodePath, Shader, TextNode
99

1010
from kphys.core import EffectorNode, IK_ENGINE_IK, IK_ENGINE_CCDIK
11-
from kphys.loader import load_actor
11+
from kphys.loader import load_model
1212

1313
from common import make_empty
1414

@@ -33,9 +33,9 @@ def __init__(self):
3333
'right': [],
3434
}
3535
self._texts = []
36-
for i in range(2):
36+
for i in range(1):
3737
filepath = os.path.join(os.path.dirname(__file__), 'yuki', 'scene.gltf')
38-
node = load_actor(filepath)
38+
node = load_model(filepath)
3939
scene = NodePath(node)
4040
actor = scene.find('**/+ArmatureNode')
4141
actor.reparent_to(self.render)
@@ -63,19 +63,21 @@ def __init__(self):
6363
for bone in actor.find_all_matches('**/+EffectorNode'):
6464
make_empty(parent=bone)
6565

66-
# actor.node().set_raw_transform(True)
6766
actor.node().rebuild_bind_pose()
6867
if i == 0:
69-
# actor.node().rebuild_ik(IK_ENGINE_IK)
7068
actor.node().rebuild_ik(IK_ENGINE_CCDIK)
7169
text = OnscreenText(
72-
text='FABRIK', pos=(i - 0.5, 0.75), align=TextNode.ACenter,
70+
text='CCD',
71+
pos=(i - 0.5, 0.75),
72+
align=TextNode.ACenter,
7373
parent=self.render2d)
7474
self._texts.append(text)
7575
else:
76-
actor.node().rebuild_ik(IK_ENGINE_CCDIK)
76+
actor.node().rebuild_ik(IK_ENGINE_IK)
7777
text = OnscreenText(
78-
text='CCD', pos=(i - 0.5, 0.75), align=TextNode.ACenter,
78+
text='FABRIK',
79+
pos=(i - 0.5, 0.75),
80+
align=TextNode.ACenter,
7981
parent=self.render2d)
8082
self._texts.append(text)
8183

0 commit comments

Comments
 (0)