|
52 | 52 | #include "modelNode.h"
|
53 | 53 | #include "animBundleNode.h"
|
54 | 54 | #include "animChannelMatrixXfmTable.h"
|
55 |
| -#include "characterJointEffect.h" |
56 | 55 | #include "characterJoint.h"
|
57 | 56 | #include "character.h"
|
58 | 57 | #include "string_utils.h"
|
@@ -159,16 +158,6 @@ convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent,
|
159 | 158 | convert_character_node(DCAST(Character, node), node_path, egg_parent, has_decal);
|
160 | 159 |
|
161 | 160 | } else {
|
162 |
| - // Is this a ModelNode that represents an exposed joint? If so, skip it, |
163 |
| - // as we'll take care of it when building the joint hierarchy. |
164 |
| - if (node->get_type() == ModelNode::get_class_type()) { |
165 |
| - ModelNode *model_node = (ModelNode *)node; |
166 |
| - if (model_node->get_preserve_transform() == ModelNode::PT_net && |
167 |
| - model_node->has_effect(CharacterJointEffect::get_class_type())) { |
168 |
| - return; |
169 |
| - } |
170 |
| - } |
171 |
| - |
172 | 161 | // Just a generic node.
|
173 | 162 | EggGroup *egg_group = new EggGroup(node->get_name());
|
174 | 163 | egg_parent->add_child(egg_group);
|
@@ -368,17 +357,6 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac
|
368 | 357 | EggGroup *joint = new EggGroup(bundleNode->get_name());
|
369 | 358 | joint->add_matrix4(transformd);
|
370 | 359 | joint->set_group_type(EggGroup::GT_joint);
|
371 |
| - |
372 |
| - // Is this joint exposed? |
373 |
| - NodePathCollection coll = character_joint->get_net_transforms(); |
374 |
| - for (size_t i = 0; i < coll.size(); ++i) { |
375 |
| - const NodePath &np = coll[i]; |
376 |
| - if (np.get_name() == bundleNode->get_name() && np.node()->is_of_type(ModelNode::get_class_type())) { |
377 |
| - joint->set_dcs_type(EggGroup::DC_net); |
378 |
| - break; |
379 |
| - } |
380 |
| - } |
381 |
| - |
382 | 360 | joint_group = joint;
|
383 | 361 | egg_parent->add_child(joint_group);
|
384 | 362 | if (joint_map != nullptr) {
|
@@ -409,33 +387,16 @@ convert_character_node(Character *node, const WorkingNodePath &node_path,
|
409 | 387 |
|
410 | 388 | // A sequence node gets converted to an ordinary EggGroup, we only apply the
|
411 | 389 | // appropriate switch attributes to turn it into a sequence.
|
| 390 | + // We have to use DT_structured since it is the only mode that preserves the |
| 391 | + // node hierarchy, including LODNodes and CollisionNodes that may be under |
| 392 | + // this Character node. |
412 | 393 | EggGroup *egg_group = new EggGroup(node->get_name());
|
| 394 | + egg_group->set_dart_type(EggGroup::DT_structured); |
413 | 395 | egg_parent->add_child(egg_group);
|
414 | 396 | apply_node_properties(egg_group, node);
|
415 | 397 |
|
416 | 398 | CharacterJointMap joint_map;
|
417 |
| - bool is_structured = false; |
418 |
| - |
419 |
| - int num_children = node->get_num_children(); |
420 |
| - for (int i = 0; i < num_children; i++) { |
421 |
| - PandaNode *child = node->get_child(i); |
422 |
| - convert_node(WorkingNodePath(node_path, child), egg_parent, has_decal, &joint_map); |
423 |
| - |
424 |
| - TypeHandle type = child->get_type(); |
425 |
| - if (child->get_num_children() > 0 || |
426 |
| - (type != GeomNode::get_class_type() && type != ModelNode::get_class_type())) { |
427 |
| - is_structured = true; |
428 |
| - } |
429 |
| - } |
430 |
| - |
431 |
| - // We have to use DT_structured if it is necessary to preserve any node |
432 |
| - // hierarchy, such as LODNodes and CollisionNodes that may be under this |
433 |
| - // Character node. |
434 |
| - if (is_structured) { |
435 |
| - egg_group->set_dart_type(EggGroup::DT_structured); |
436 |
| - } else { |
437 |
| - egg_group->set_dart_type(EggGroup::DT_default); |
438 |
| - } |
| 399 | + recurse_nodes(node_path, egg_group, has_decal, &joint_map); |
439 | 400 |
|
440 | 401 | // turn it into a switch.. egg_group->set_switch_flag(true);
|
441 | 402 |
|
|
0 commit comments