From 3a761fc27c52a00e16ef931bab133506e9c69992 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 4 Nov 2003 05:23:57 +0000 Subject: [PATCH] support egg visibility scalar --- pandatool/src/bam/eggToBam.cxx | 16 ++++++++++++++-- pandatool/src/bam/eggToBam.h | 1 + pandatool/src/maya/maya_funcs.cxx | 3 --- pandatool/src/mayaegg/mayaNodeTree.cxx | 11 +++++------ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/pandatool/src/bam/eggToBam.cxx b/pandatool/src/bam/eggToBam.cxx index 3c799925c3..c186c3d9ea 100644 --- a/pandatool/src/bam/eggToBam.cxx +++ b/pandatool/src/bam/eggToBam.cxx @@ -46,7 +46,7 @@ EggToBam() : add_path_store_options(); add_option - ("fl", "flag", 0, + ("flatten", "flag", 0, "Specifies whether to flatten the egg hierarchy after it is loaded. " "If flag is zero, the egg hierarchy will not be flattened, but will " "instead be written to the bam file exactly as it is. If flag is " @@ -56,6 +56,14 @@ EggToBam() : "variable.", &EggToBam::dispatch_int, &_has_egg_flatten, &_egg_flatten); + add_option + ("suppress-hidden", "flag", 0, + "Specifies whether to suppress hidden geometry. If this is nonzero, " + "egg geometry tagged as \"hidden\" will be removed from the final " + "scene graph; otherwise, it will be preserved (but stashed). The " + "default is nonzero, to remove it.", + &EggToBam::dispatch_int, NULL, &_egg_suppress_hidden); + add_option ("ls", "", 0, "Writes a scene graph listing to standard output after the egg " @@ -88,6 +96,7 @@ EggToBam() : _force_complete = true; _egg_flatten = 0; + _egg_suppress_hidden = 1; } //////////////////////////////////////////////////////////////////// @@ -98,11 +107,14 @@ EggToBam() : void EggToBam:: run() { if (_has_egg_flatten) { - // If the user specified some -fl, we need to set the + // If the user specified some -flatten, we need to set the // corresponding Configrc variable. egg_flatten = (_egg_flatten != 0); } + // We always set egg_suppress_hidden. + egg_suppress_hidden = _egg_suppress_hidden; + if (_compression_off) { // If the user specified -NC, turn off channel compression. compress_channels = false; diff --git a/pandatool/src/bam/eggToBam.h b/pandatool/src/bam/eggToBam.h index 0372ece01f..df840c8597 100644 --- a/pandatool/src/bam/eggToBam.h +++ b/pandatool/src/bam/eggToBam.h @@ -39,6 +39,7 @@ protected: private: bool _has_egg_flatten; int _egg_flatten; + bool _egg_suppress_hidden; bool _ls; bool _has_compression_quality; int _compression_quality; diff --git a/pandatool/src/maya/maya_funcs.cxx b/pandatool/src/maya/maya_funcs.cxx index 75b60025c2..5476c6d0d5 100644 --- a/pandatool/src/maya/maya_funcs.cxx +++ b/pandatool/src/maya/maya_funcs.cxx @@ -50,9 +50,6 @@ get_maya_plug(MObject &node, const string &attribute_name, MPlug &plug) { MObject attr = node_fn.attribute(attribute_name.c_str(), &status); if (!status) { - maya_cat.debug() - << "Object " << node_fn.name() << " does not support attribute " - << attribute_name << "\n"; return false; } diff --git a/pandatool/src/mayaegg/mayaNodeTree.cxx b/pandatool/src/mayaegg/mayaNodeTree.cxx index 113a3ef9ad..fb760c13ee 100755 --- a/pandatool/src/mayaegg/mayaNodeTree.cxx +++ b/pandatool/src/mayaegg/mayaNodeTree.cxx @@ -275,15 +275,14 @@ 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.) + // Is the node flagged to be invisible? If it is, it is tagged + // with the "hidden" visibility flag, so it won't get converted + // in the normal case (unless it represents a collision solid or + // something). 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"); + egg_group->set_visibility_mode(EggGroup::VM_hidden); } // We treat the object type "billboard" as a special case: we