2
0
Эх сурвалжийг харах

support egg visibility scalar

David Rose 22 жил өмнө
parent
commit
3a761fc27c

+ 14 - 2
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;

+ 1 - 0
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;

+ 0 - 3
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;
   }
 

+ 5 - 6
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