فهرست منبع

made the keep-all-uvsets to propagete to the child nodes

Asad M. Zaman 20 سال پیش
والد
کامیت
869d2afc0d
3فایلهای تغییر یافته به همراه23 افزوده شده و 1 حذف شده
  1. 20 0
      pandatool/src/mayaegg/mayaNodeDesc.cxx
  2. 1 0
      pandatool/src/mayaegg/mayaNodeDesc.h
  3. 2 1
      pandatool/src/mayaegg/mayaToEggConverter.cxx

+ 20 - 0
pandatool/src/mayaegg/mayaNodeDesc.cxx

@@ -21,6 +21,7 @@
 #include "mayaBlendDesc.h"
 #include "mayaToEggConverter.h"
 #include "maya_funcs.h"
+#include "eggGroup.h"
 #include "config_mayaegg.h"
 
 #include "pre_maya_include.h"
@@ -244,6 +245,25 @@ tag() {
   _tagged = true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: MayaNodeDesc::has_object_type
+//       Access: Public
+//  Description: Returns true if this node or any of its parent
+//               has_object_type of object_type.
+////////////////////////////////////////////////////////////////////
+bool MayaNodeDesc::
+has_object_type(string object_type) const {
+  bool ret = false;
+  if ((_egg_group != (EggGroup*) NULL) 
+      && _egg_group->has_object_type(object_type)) {
+    return true;
+  }
+  if (_parent != (MayaNodeDesc *)NULL) {
+    ret |= _parent->has_object_type(object_type);
+  }
+  return ret;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: MayaNodeDesc::tag_recursively
 //       Access: Private

+ 1 - 0
pandatool/src/mayaegg/mayaNodeDesc.h

@@ -61,6 +61,7 @@ public:
   bool is_joint_parent() const;
 
   bool is_tagged() const;
+  bool has_object_type(string object_type) const;
 
   MayaNodeTree *_tree;
   MayaNodeDesc *_parent;

+ 2 - 1
pandatool/src/mayaegg/mayaToEggConverter.cxx

@@ -1744,7 +1744,8 @@ make_polyset(MayaNodeDesc *node_desc, const MDagPath &dag_path,
     }
   }
 
-  bool keep_all_uvsets = egg_group->has_object_type("keep-all-uvsets");
+  //bool keep_all_uvsets = egg_group->has_object_type("keep-all-uvsets");
+  bool keep_all_uvsets = node_desc->has_object_type("keep-all-uvsets");
   if (keep_all_uvsets)
     mayaegg_cat.info() << "will keep_all_uvsets" << endl;