From 869d2afc0dfcce83959444b181edd835501072fe Mon Sep 17 00:00:00 2001 From: "Asad M. Zaman" Date: Thu, 9 Mar 2006 01:46:57 +0000 Subject: [PATCH] made the keep-all-uvsets to propagete to the child nodes --- pandatool/src/mayaegg/mayaNodeDesc.cxx | 20 ++++++++++++++++++++ pandatool/src/mayaegg/mayaNodeDesc.h | 1 + pandatool/src/mayaegg/mayaToEggConverter.cxx | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/pandatool/src/mayaegg/mayaNodeDesc.cxx b/pandatool/src/mayaegg/mayaNodeDesc.cxx index bfb0820d4e..5dffa09725 100755 --- a/pandatool/src/mayaegg/mayaNodeDesc.cxx +++ b/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 diff --git a/pandatool/src/mayaegg/mayaNodeDesc.h b/pandatool/src/mayaegg/mayaNodeDesc.h index a43172ba44..cf1f64dd11 100755 --- a/pandatool/src/mayaegg/mayaNodeDesc.h +++ b/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; diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index 064798632c..148c9022a9 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/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;