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. | |
bool | build_hierarchy () |
Walks through the complete Maya hierarchy but does not tag any nodes for conversion. | |
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. | |
void | clear () |
Resets the entire tree in preparation for repopulating with a new scene. | |
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. | |
MayaBlendDesc * | get_blend_desc (int n) const |
Returns the nth MayaBlendDesc object discovered in the tree. | |
EggXfmSAnim * | get_egg_anim (MayaNodeDesc *node_desc) |
Returns the anim table corresponding to the joint for the indicated node. | |
EggGroup * | get_egg_group (MayaNodeDesc *node_desc) |
Returns the EggGroupNode corresponding to the group or joint for the indicated node. | |
EggSAnimData * | get_egg_slider (MayaBlendDesc *blend_desc) |
Returns the anim table corresponding to the slider for the indicated blend. | |
EggTable * | get_egg_table (MayaNodeDesc *node_desc) |
Returns the EggTable corresponding to the joint for the indicated node. | |
MayaNodeDesc * | get_node (int n) const |
Returns the nth node in the hierarchy, in an arbitrary ordering. | |
int | get_num_blend_descs () const |
Returns the number of unique MayaBlendDesc objects (and hence the number of morph sliders) discovered in the tree. | |
int | get_num_nodes () const |
Returns the total number of nodes in the hierarchy, not counting the root node. | |
bool | ignore_slider (const std::string &name) const |
Returns true if the indicated name is on the list of sliders to ignore, false otherwise. | |
PT (MayaNodeDesc) _root | |
void | report_ignored_slider (const std::string &name) |
Outputs a message to the user reporting that a slider was ignored. | |
void | reset_sliders () |
Resets all of the sliders associated with all blend shapes down to 0. | |
void | tag_all () |
Tags the entire hierarchy for conversion. | |
void | tag_joint_all () |
Tags the entire hierarchy for conversion. | |
bool | tag_joint_named (const GlobPattern &glob) |
Tags nodes matching the indicated glob (and all of their children) for conversion. | |
bool | tag_named (const GlobPattern &glob) |
Tags nodes matching the indicated glob (and all of their children) for conversion. | |
bool | tag_selected () |
Tags the just the selected hierarchy for conversion, or the entire hierarchy if nothing is selected. | |
bool | untag_named (const GlobPattern &glob) |
Un-tags nodes matching the indicated glob (and all of their children) for conversion. | |
Public Attributes | |
PN_stdfloat | _fps |
std::string | _subroot_parent_name |
Describes a complete tree of maya nodes for conversion.
Definition at line 37 of file mayaNodeTree.h.
MayaNodeTree::MayaNodeTree | ( | MayaToEggConverter * | converter | ) |
Definition at line 42 of file mayaNodeTree.cxx.
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 547 of file mayaNodeTree.cxx.
bool MayaNodeTree::build_hierarchy | ( | ) |
Walks through the complete Maya hierarchy but does not tag any nodes for conversion.
Definition at line 69 of file mayaNodeTree.cxx.
References build_node().
Referenced by MayaToEggConverter::convert_maya().
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 58 of file mayaNodeTree.cxx.
References MayaNodeDesc::from_dag_path().
Referenced by build_hierarchy(), and tag_selected().
void MayaNodeTree::clear | ( | ) |
Resets the entire tree in preparation for repopulating with a new scene.
Definition at line 273 of file mayaNodeTree.cxx.
Referenced by MayaToEggConverter::clear().
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 289 of file mayaNodeTree.cxx.
References ordered_vector< Key, Compare, Vector >::begin(), and ordered_vector< Key, Compare, Vector >::end().
MayaBlendDesc * MayaNodeTree::get_blend_desc | ( | int | n | ) | const |
Returns the nth MayaBlendDesc object discovered in the tree.
Definition at line 566 of file mayaNodeTree.cxx.
References ordered_vector< Key, Compare, Vector >::size().
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 490 of file mayaNodeTree.cxx.
References 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 308 of file mayaNodeTree.cxx.
References EggGroupNode::add_child(), SomethingToEggConverter::get_animation_convert(), get_bool_attribute(), MayaNodeDesc::get_dag_path(), get_egg_group(), get_enum_attribute(), get_tag_attribute_names(), EggObject::get_user_data(), get_vec3d_attribute(), has_attribute(), 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(), and EggRenderMode::set_visibility_mode().
Referenced by get_egg_group().
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 500 of file mayaNodeTree.cxx.
References EggGroupNode::add_child().
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 456 of file mayaNodeTree.cxx.
References EggGroupNode::add_child(), EggData::get_coordinate_system, get_egg_table(), and MayaNodeDesc::is_joint().
Referenced by get_egg_anim(), and get_egg_table().
MayaNodeDesc * MayaNodeTree::get_node | ( | int | n | ) | const |
Returns the nth node in the hierarchy, in an arbitrary ordering.
Definition at line 264 of file mayaNodeTree.cxx.
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 558 of file mayaNodeTree.cxx.
References ordered_vector< Key, Compare, Vector >::size().
int MayaNodeTree::get_num_nodes | ( | ) | const |
Returns the total number of nodes in the hierarchy, not counting the root node.
Definition at line 256 of file mayaNodeTree.cxx.
bool MayaNodeTree::ignore_slider | ( | const std::string & | name | ) | const |
Returns true if the indicated name is on the list of sliders to ignore, false otherwise.
Definition at line 520 of file mayaNodeTree.cxx.
References MayaToEggConverter::ignore_slider().
void MayaNodeTree::report_ignored_slider | ( | const std::string & | name | ) |
Outputs a message to the user reporting that a slider was ignored.
Each slider is only reported once.
Definition at line 529 of file mayaNodeTree.cxx.
void MayaNodeTree::reset_sliders | ( | ) |
Resets all of the sliders associated with all blend shapes down to 0.
Definition at line 575 of file mayaNodeTree.cxx.
References ordered_vector< Key, Compare, Vector >::begin(), and ordered_vector< Key, Compare, Vector >::end().
void MayaNodeTree::tag_all | ( | ) |
Tags the entire hierarchy for conversion.
This is the normal behavior.
Definition at line 143 of file mayaNodeTree.cxx.
Referenced by MayaToEggConverter::convert_maya(), and tag_selected().
void MayaNodeTree::tag_joint_all | ( | ) |
Tags the entire hierarchy for conversion.
This is the normal behavior.
Definition at line 113 of file mayaNodeTree.cxx.
Referenced by MayaToEggConverter::convert_maya().
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 123 of file mayaNodeTree.cxx.
References GlobPattern::matches().
Referenced by MayaToEggConverter::convert_maya().
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 153 of file mayaNodeTree.cxx.
References GlobPattern::matches().
Referenced by MayaToEggConverter::convert_maya().
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 197 of file mayaNodeTree.cxx.
References build_node(), and tag_all().
Referenced by MayaToEggConverter::convert_maya().
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 175 of file mayaNodeTree.cxx.
References GlobPattern::matches().
Referenced by MayaToEggConverter::convert_maya().
PN_stdfloat MayaNodeTree::_fps |
Definition at line 75 of file mayaNodeTree.h.
std::string MayaNodeTree::_subroot_parent_name |
Definition at line 73 of file mayaNodeTree.h.