From 1ec650644e8bc1f75396030abfb24a1afb1bf59a Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 22 Sep 2003 23:26:46 +0000 Subject: [PATCH] invisible flag should not eliminate collision solids --- pandatool/src/mayaegg/mayaNodeTree.cxx | 11 +++++++++ pandatool/src/mayaegg/mayaToEggConverter.cxx | 24 +++----------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/pandatool/src/mayaegg/mayaNodeTree.cxx b/pandatool/src/mayaegg/mayaNodeTree.cxx index ef0cb2c76e..31f54946af 100755 --- a/pandatool/src/mayaegg/mayaNodeTree.cxx +++ b/pandatool/src/mayaegg/mayaNodeTree.cxx @@ -258,6 +258,17 @@ get_egg_group(MayaNodeDesc *node_desc) { egg_group->add_object_type(object_type); } + // Is the node flagged to be invisible? If it is, and is has no + // other egg flags, it is implicitly tagged "backstage", so it + // won't get converted. (But it might be an invisible collision + // solid, which is why we do this only if it has no other egg + // flags.) + bool visible = true; + get_bool_attribute(dag_object, "visibility", visible); + if (!visible && egg_group->get_num_object_types() == 0) { + egg_group->add_object_type("backstage"); + } + // We treat the object type "billboard" as a special case: we // apply this one right away and also flag the group as an // instance. diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index 7c11f59087..16a7f51fd1 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -534,15 +534,9 @@ process_model_node(MayaNodeDesc *node_desc) { } MObject node = dag_path.transform(&status); - - bool visible; - if (!get_bool_attribute(node, "visibility", visible)) { - if (mayaegg_cat.is_debug()) { - mayaegg_cat.debug() - << "Couldn't get visibility attribute for " << dag_node.name() - << "\n"; - } - visible = true; + if (!status) { + status.perror("dag_path.transform()"); + return false; } string path = dag_path.fullPathName().asChar(); @@ -556,11 +550,6 @@ process_model_node(MayaNodeDesc *node_desc) { << " (animated)"; } - if (!visible) { - mayaegg_cat.debug(false) - << " (invisible)"; - } - mayaegg_cat.debug(false) << "\n"; } @@ -572,13 +561,6 @@ process_model_node(MayaNodeDesc *node_desc) { get_joint_transform(dag_path, egg_group); } - } else if (!visible) { - if (mayaegg_cat.is_debug()) { - mayaegg_cat.debug() - << "Ignoring invisible node " << path - << "\n"; - } - } else if (dag_node.inUnderWorld()) { if (mayaegg_cat.is_debug()) { mayaegg_cat.debug()