14 #ifndef MAYATOEGGCONVERTER_H
15 #define MAYATOEGGCONVERTER_H
32 #include <maya/MDagPath.h>
33 #include <maya/MItMeshPolygon.h>
60 virtual std::string
get_name()
const;
90 bool open_api(
bool revert_directory=
true);
94 bool convert_flip(
double start_frame,
double end_frame,
95 double frame_inc,
double output_frame_rate);
97 bool convert_char_model();
98 bool convert_char_chan(
double start_frame,
double end_frame,
99 double frame_inc,
double output_frame_rate);
103 void get_transform(
MayaNodeDesc *node_desc,
const MDagPath &dag_path,
105 void get_joint_transform(
const MDagPath &dag_path,
EggGroup *egg_group);
106 void apply_lod_attributes(
EggGroup *egg_group, MFnDagNode &lod_group);
113 const MDagPath &dag_path,
114 MFnNurbsSurface &surface,
117 const std::string &nurbs_name,
119 int trim_curve_index);
120 void make_nurbs_curve(
const MDagPath &dag_path,
121 const MFnNurbsCurve &curve,
123 void make_polyset(
MayaNodeDesc *node_desc,
const MDagPath &dag_path,
124 const MFnMesh &mesh,
EggGroup *egg_group,
126 void make_locator(
const MDagPath &dag_path,
const MFnDagNode &dag_node,
128 void make_camera_locator(
const MDagPath &dag_path,
const MFnDagNode &dag_node,
130 void make_light_locator(
const MDagPath &dag_path,
const MFnDagNode &dag_node,
132 bool get_vertex_weights(
const MDagPath &dag_path,
const MFnMesh &mesh,
134 bool get_vertex_weights(
const MDagPath &dag_path,
const MFnNurbsSurface &surface,
142 void apply_texture_alpha_filename(
EggTexture &tex,
153 void set_vertex_color(
EggVertex &vert, MItMeshPolygon &pi,
int vert_index,
const MayaShader *shader,
const LColor &color);
155 void set_vertex_color_legacy(
EggVertex &vert, MItMeshPolygon &pi,
int vert_index,
const MayaShader *shader,
const LColor &color);
157 void set_vertex_color_modern(
EggVertex &vert, MItMeshPolygon &pi,
int vert_index,
const MayaShader *shader,
const LColor &color);
159 int round(
double value);
161 std::string _program_name;
163 bool _from_selection;
164 std::string _subroot;
169 Globs _ignore_sliders;
179 bool _polygon_output;
180 double _polygon_tolerance;
181 bool _respect_maya_double_sided;
182 bool _always_show_vertex_color;
183 bool _keep_all_uvsets;
184 bool _convert_cameras;
185 bool _convert_lights;
197 TransformType _transform_type;
This is the primary interface into all the egg data, and the root of the egg file structure.
A base class for nodes in the hierarchy that are not leaf nodes.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
A parametric NURBS curve.
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
This is a collection of textures by TRef name.
Defines a texture map that may be applied to geometry.
A collection of vertices.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine <S$Anim> entries that...
The name of a file, such as a texture file or an Egg file.
This class can be used to test for string matches against standard Unix- shell filename globbing conv...
This class presents a wrapper around the global Maya interface.
Describes a single instance of a node in the Maya scene graph, relating it to the corresponding egg s...
Describes a complete tree of maya nodes for conversion.
This defines the various attributes that Maya may associate with the "color" channel for a particular...
Corresponds to a single "shader" in Maya.
Collects the set of MayaShaders that have been encountered so far.
This class supervises the construction of an EggData structure from a single Maya file,...
void set_from_selection(bool from_selection)
Sets the flag that indicates whether the currently selected Maya geometry will be converted.
bool convert_maya()
Fills up the egg_data structure according to the global maya model data.
void clear_ignore_sliders()
Empties the list of ignore_sliders added via add_ignore_slider().
bool open_api(bool revert_directory=true)
Attempts to open the Maya API if it was not already open, and returns true if successful,...
virtual std::string get_name() const
Returns the English name of the file type this converter supports.
void clear_force_joints()
Empties the list of force_joints added via add_force_joint().
virtual DistanceUnit get_input_units()
This may be called after convert_file() has been called and returned true, indicating a successful co...
static TransformType string_transform_type(const std::string &arg)
Returns the TransformType value corresponding to the indicated string, or TT_invalid.
virtual std::string get_additional_extensions() const
Returns a space-separated list of extension, in addition to the one returned by get_extension(),...
void close_api()
Closes the Maya API, if it was previously opened.
void clear()
Frees all of the Maya pointers kept within this object, in preparation for loading a new scene or rel...
void clear_subsets()
Empties the list of subset nodes added via add_subset().
virtual std::string get_extension() const
Returns the common extension of the file type this converter supports.
virtual bool convert_file(const Filename &filename)
Handles the reading of the input file and converting it to egg.
void add_ignore_slider(const GlobPattern &glob)
Adds a name pattern to the list of ignore_sliders.
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
void clear_subroots()
Empties the list of subroot nodes added via add_subroot().
void add_subset(const GlobPattern &glob)
Adds a name pattern to the list of subset nodes.
bool force_joint(const std::string &name) const
Returns true if the indicated name is on the list of DAG nodes to treat as a joint,...
void add_force_joint(const GlobPattern &glob)
Adds a name pattern to the list of force_joints.
bool ignore_slider(const std::string &name) const
Returns true if the indicated name is on the list of sliders to ignore, false otherwise.
void add_subroot(const GlobPattern &glob)
Adds a name pattern to the list of subroot nodes.
void clear_excludes()
Empties the list of excluded nodes added via add_exclude().
void add_exclude(const GlobPattern &glob)
Adds a name pattern to the list of excluded nodes.
This is a base class for a family of converter classes that manage a conversion from some file type t...
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
DistanceUnit
This enumerated type lists all the kinds of units we're likely to come across in model conversion pro...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.