Skip to content

Commit c61b480

Browse files
committed
Revert "bam2egg: support exposed joints properly"
This reverts commit dee4cd6. Fixes panda3d#237
1 parent 6559932 commit c61b480

File tree

1 file changed

+5
-44
lines changed

1 file changed

+5
-44
lines changed

panda/src/egg2pg/eggSaver.cxx

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include "modelNode.h"
5353
#include "animBundleNode.h"
5454
#include "animChannelMatrixXfmTable.h"
55-
#include "characterJointEffect.h"
5655
#include "characterJoint.h"
5756
#include "character.h"
5857
#include "string_utils.h"
@@ -159,16 +158,6 @@ convert_node(const WorkingNodePath &node_path, EggGroupNode *egg_parent,
159158
convert_character_node(DCAST(Character, node), node_path, egg_parent, has_decal);
160159

161160
} 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-
172161
// Just a generic node.
173162
EggGroup *egg_group = new EggGroup(node->get_name());
174163
egg_parent->add_child(egg_group);
@@ -368,17 +357,6 @@ convert_character_bundle(PartGroup *bundleNode, EggGroupNode *egg_parent, Charac
368357
EggGroup *joint = new EggGroup(bundleNode->get_name());
369358
joint->add_matrix4(transformd);
370359
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-
382360
joint_group = joint;
383361
egg_parent->add_child(joint_group);
384362
if (joint_map != nullptr) {
@@ -409,33 +387,16 @@ convert_character_node(Character *node, const WorkingNodePath &node_path,
409387

410388
// A sequence node gets converted to an ordinary EggGroup, we only apply the
411389
// 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.
412393
EggGroup *egg_group = new EggGroup(node->get_name());
394+
egg_group->set_dart_type(EggGroup::DT_structured);
413395
egg_parent->add_child(egg_group);
414396
apply_node_properties(egg_group, node);
415397

416398
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);
439400

440401
// turn it into a switch.. egg_group->set_switch_flag(true);
441402

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy