Panda3D
|
Describes a complete tree of maya nodes for conversion. More...
#include "mayaNodeTree.h"
Public Member Functions | |
MayaNodeTree (MayaToEggConverter *converter) | |
MayaBlendDesc * | add_blend_desc (MayaBlendDesc *blend_desc) |
Adds the indicated MayaBlendDesc object to the list of blends collected so far. More... | |
bool | build_hierarchy () |
Walks through the complete Maya hierarchy but does not tag any nodes for conversion. More... | |
MayaNodeDesc * | build_node (const MDagPath &dag_path) |
Returns a pointer to the node corresponding to the indicated dag_path object, creating it first if necessary. More... | |
void | clear () |
Resets the entire tree in preparation for repopulating with a new scene. More... | |
void | clear_egg (EggData *egg_data, EggGroupNode *egg_root, EggGroupNode *skeleton_node, EggGroupNode *morph_node) |
Removes all of the references to generated egg structures from the tree, and prepares the tree for generating new egg structures. More... | |
MayaBlendDesc * | get_blend_desc (int n) const |
Returns the nth MayaBlendDesc object discovered in the tree. More... | |
EggXfmSAnim * | get_egg_anim (MayaNodeDesc *node_desc) |
Returns the anim table corresponding to the joint for the indicated node. More... | |
EggGroup * | get_egg_group (MayaNodeDesc *node_desc) |
Returns the EggGroupNode corresponding to the group or joint for the indicated node. More... | |
EggSAnimData * | get_egg_slider (MayaBlendDesc *blend_desc) |
Returns the anim table corresponding to the slider for the indicated blend. More... | |
EggTable * | get_egg_table (MayaNodeDesc *node_desc) |
Returns the EggTable corresponding to the joint for the indicated node. More... | |
MayaNodeDesc * | get_node (int n) const |
Returns the nth node in the hierarchy, in an arbitrary ordering. More... | |
int | get_num_blend_descs () const |
Returns the number of unique MayaBlendDesc objects (and hence the number of morph sliders) discovered in the tree. More... | |
int | get_num_nodes () const |
Returns the total number of nodes in the hierarchy, not counting the root node. More... | |
bool | ignore_slider (const string &name) const |
Returns true if the indicated name is on the list of sliders to ignore, false otherwise. More... | |
PT (MayaNodeDesc) _root | |
void | report_ignored_slider (const string &name) |
Outputs a message to the user reporting that a slider was ignored. More... | |
void | reset_sliders () |
Resets all of the sliders associated with all blend shapes down to 0. More... | |
void | tag_all () |
Tags the entire hierarchy for conversion. More... | |
void | tag_joint_all () |
Tags the entire hierarchy for conversion. More... | |
bool | tag_joint_named (const GlobPattern &glob) |
Tags nodes matching the indicated glob (and all of their children) for conversion. More... | |
bool | tag_named (const GlobPattern &glob) |
Tags nodes matching the indicated glob (and all of their children) for conversion. More... | |
bool | tag_selected () |
Tags the just the selected hierarchy for conversion, or the entire hierarchy if nothing is selected. More... | |
bool | untag_named (const GlobPattern &glob) |
Un-tags nodes matching the indicated glob (and all of their children) for conversion. More... | |
Public Attributes | |
PN_stdfloat | _fps |
string | _subroot_parent_name |
Describes a complete tree of maya nodes for conversion.
Definition at line 40 of file mayaNodeTree.h.
MayaBlendDesc * MayaNodeTree::add_blend_desc | ( | MayaBlendDesc * | blend_desc | ) |
Adds the indicated MayaBlendDesc object to the list of blends collected so far.
If a MayaBlendDesc object with the same name is already part of the tree, the supplied object is discarded and the previously-added object is returned; otherwise, the supplied object is added to the tree and the same object is returned.
In either case, the return value is the MayaBlendDesc that should be used henceforth.
Definition at line 598 of file mayaNodeTree.cxx.
References get_num_blend_descs().
Referenced by report_ignored_slider().
bool MayaNodeTree::build_hierarchy | ( | ) |
Walks through the complete Maya hierarchy but does not tag any nodes for conversion.
Definition at line 74 of file mayaNodeTree.cxx.
References build_node(), and tag_joint_all().
Referenced by build_node().
MayaNodeDesc * MayaNodeTree::build_node | ( | const MDagPath & | dag_path | ) |
Returns a pointer to the node corresponding to the indicated dag_path object, creating it first if necessary.
Definition at line 61 of file mayaNodeTree.cxx.
References build_hierarchy(), and MayaNodeDesc::from_dag_path().
Referenced by build_hierarchy(), and tag_selected().
void MayaNodeTree::clear | ( | void | ) |
Resets the entire tree in preparation for repopulating with a new scene.
Definition at line 307 of file mayaNodeTree.cxx.
References clear_egg().
Referenced by MayaToEggConverter::close_api(), MayaToEggConverter::convert_file(), MayaToEggConverter::convert_maya(), and get_node().
void MayaNodeTree::clear_egg | ( | EggData * | egg_data, |
EggGroupNode * | egg_root, | ||
EggGroupNode * | skeleton_node, | ||
EggGroupNode * | morph_node | ||
) |
Removes all of the references to generated egg structures from the tree, and prepares the tree for generating new egg structures.
Definition at line 326 of file mayaNodeTree.cxx.
References get_egg_group().
Referenced by clear().
MayaBlendDesc * MayaNodeTree::get_blend_desc | ( | int | n | ) | const |
Returns the nth MayaBlendDesc object discovered in the tree.
Definition at line 623 of file mayaNodeTree.cxx.
References reset_sliders().
Referenced by get_num_blend_descs().
EggXfmSAnim * MayaNodeTree::get_egg_anim | ( | MayaNodeDesc * | node_desc | ) |
Returns the anim table corresponding to the joint for the indicated node.
Creates the table node if it has not already been created.
Definition at line 530 of file mayaNodeTree.cxx.
References get_egg_slider(), and get_egg_table().
Referenced by get_egg_table().
EggGroup * MayaNodeTree::get_egg_group | ( | MayaNodeDesc * | node_desc | ) |
Returns the EggGroupNode corresponding to the group or joint for the indicated node.
Creates the group node if it has not already been created.
Definition at line 348 of file mayaNodeTree.cxx.
References EggGroupNode::add_child(), MayaNodeDesc::get_dag_path(), get_egg_table(), EggObject::get_user_data(), MayaNodeDesc::has_dag_path(), EggGroup::has_object_type(), EggObject::has_user_data(), MayaNodeDesc::is_joint(), EggGroup::remove_object_type(), EggGroup::set_tag(), EggObject::set_user_data(), EggRenderMode::set_visibility_mode(), and LPoint3d::zero().
Referenced by clear_egg().
EggSAnimData * MayaNodeTree::get_egg_slider | ( | MayaBlendDesc * | blend_desc | ) |
Returns the anim table corresponding to the slider for the indicated blend.
Creates the table node if it has not already been created.
Definition at line 543 of file mayaNodeTree.cxx.
References ignore_slider().
Referenced by get_egg_anim().
EggTable * MayaNodeTree::get_egg_table | ( | MayaNodeDesc * | node_desc | ) |
Returns the EggTable corresponding to the joint for the indicated node.
Creates the table node if it has not already been created.
Definition at line 493 of file mayaNodeTree.cxx.
References EggGroupNode::add_child(), get_egg_anim(), and MayaNodeDesc::is_joint().
Referenced by get_egg_anim(), and get_egg_group().
MayaNodeDesc * MayaNodeTree::get_node | ( | int | n | ) | const |
Returns the nth node in the hierarchy, in an arbitrary ordering.
Definition at line 295 of file mayaNodeTree.cxx.
References clear().
Referenced by get_num_nodes().
int MayaNodeTree::get_num_blend_descs | ( | ) | const |
Returns the number of unique MayaBlendDesc objects (and hence the number of morph sliders) discovered in the tree.
Definition at line 612 of file mayaNodeTree.cxx.
References get_blend_desc().
Referenced by add_blend_desc().
int MayaNodeTree::get_num_nodes | ( | ) | const |
Returns the total number of nodes in the hierarchy, not counting the root node.
Definition at line 284 of file mayaNodeTree.cxx.
References get_node().
Referenced by tag_selected().
bool MayaNodeTree::ignore_slider | ( | const string & | name | ) | const |
Returns true if the indicated name is on the list of sliders to ignore, false otherwise.
Definition at line 565 of file mayaNodeTree.cxx.
References report_ignored_slider().
Referenced by get_egg_slider().
void MayaNodeTree::report_ignored_slider | ( | const string & | name | ) |
Outputs a message to the user reporting that a slider was ignored.
Each slider is only reported once.
Definition at line 576 of file mayaNodeTree.cxx.
References add_blend_desc().
Referenced by ignore_slider().
void MayaNodeTree::reset_sliders | ( | ) |
Resets all of the sliders associated with all blend shapes down to 0.
Definition at line 635 of file mayaNodeTree.cxx.
Referenced by get_blend_desc().
void MayaNodeTree::tag_all | ( | ) |
Tags the entire hierarchy for conversion.
This is the normal behavior.
Definition at line 158 of file mayaNodeTree.cxx.
References tag_named().
Referenced by tag_joint_named(), and tag_selected().
void MayaNodeTree::tag_joint_all | ( | ) |
Tags the entire hierarchy for conversion.
This is the normal behavior.
Definition at line 121 of file mayaNodeTree.cxx.
References tag_joint_named().
Referenced by build_hierarchy().
bool MayaNodeTree::tag_joint_named | ( | const GlobPattern & | glob | ) |
Tags nodes matching the indicated glob (and all of their children) for conversion.
Returns true on success, false otherwise (e.g. the named node does not exist).
Definition at line 134 of file mayaNodeTree.cxx.
References GlobPattern::matches(), and tag_all().
Referenced by tag_joint_all().
bool MayaNodeTree::tag_named | ( | const GlobPattern & | glob | ) |
Tags nodes matching the indicated glob (and all of their children) for conversion.
Returns true on success, false otherwise (e.g. the named node does not exist).
Definition at line 171 of file mayaNodeTree.cxx.
References GlobPattern::matches(), and untag_named().
Referenced by tag_all().
bool MayaNodeTree::tag_selected | ( | ) |
Tags the just the selected hierarchy for conversion, or the entire hierarchy if nothing is selected.
Returns true on success, false on failure.
Definition at line 222 of file mayaNodeTree.cxx.
References build_node(), get_num_nodes(), and tag_all().
Referenced by untag_named().
bool MayaNodeTree::untag_named | ( | const GlobPattern & | glob | ) |
Un-tags nodes matching the indicated glob (and all of their children) for conversion.
Returns true on success, false otherwise (e.g. the named node does not exist).
Definition at line 197 of file mayaNodeTree.cxx.
References GlobPattern::matches(), and tag_selected().
Referenced by tag_named().