15 #ifndef MAYATOEGGCONVERTER_H
16 #define MAYATOEGGCONVERTER_H
18 #include "pandatoolbase.h"
19 #include "somethingToEggConverter.h"
20 #include "mayaNodeTree.h"
23 #include "mayaShaders.h"
24 #include "mayaShaderColorDef.h"
25 #include "eggTextureCollection.h"
26 #include "distanceUnit.h"
27 #include "coordinateSystem.h"
28 #include "globPattern.h"
30 #include "vector_string.h"
32 #include "pre_maya_include.h"
33 #include <maya/MDagPath.h>
34 #include <maya/MItMeshPolygon.h>
35 #include "post_maya_include.h"
49 class MFnNurbsSurface;
103 bool open_api(
bool revert_directory=
true);
107 bool convert_flip(
double start_frame,
double end_frame,
108 double frame_inc,
double output_frame_rate);
110 bool convert_char_model();
111 bool convert_char_chan(
double start_frame,
double end_frame,
112 double frame_inc,
double output_frame_rate);
116 void get_transform(
MayaNodeDesc *node_desc,
const MDagPath &dag_path,
118 void get_joint_transform(
const MDagPath &dag_path,
EggGroup *egg_group);
119 void apply_lod_attributes(
EggGroup *egg_group, MFnDagNode &lod_group);
127 const MDagPath &dag_path,
128 MFnNurbsSurface &surface,
131 const string &nurbs_name,
133 int trim_curve_index);
134 void make_nurbs_curve(
const MDagPath &dag_path,
135 const MFnNurbsCurve &curve,
137 void make_polyset(
MayaNodeDesc *node_desc,
const MDagPath &dag_path,
138 const MFnMesh &mesh,
EggGroup *egg_group,
140 void make_locator(
const MDagPath &dag_path,
const MFnDagNode &dag_node,
142 void make_camera_locator(
const MDagPath &dag_path,
const MFnDagNode &dag_node,
144 void make_light_locator(
const MDagPath &dag_path,
const MFnDagNode &dag_node,
146 bool get_vertex_weights(
const MDagPath &dag_path,
const MFnMesh &mesh,
148 bool get_vertex_weights(
const MDagPath &dag_path,
const MFnNurbsSurface &surface,
156 void apply_texture_alpha_filename(
EggTexture &tex,
169 void set_vertex_color_legacy(
EggVertex &vert, MItMeshPolygon &pi,
int vert_index,
const MayaShader *shader,
const LColor &color);
171 void set_vertex_color_modern(
EggVertex &vert, MItMeshPolygon &pi,
int vert_index,
const MayaShader *shader,
const LColor &color);
173 int round(
double value);
175 string _program_name;
177 bool _from_selection;
183 Globs _ignore_sliders;
193 bool _polygon_output;
194 double _polygon_tolerance;
195 bool _respect_maya_double_sided;
196 bool _always_show_vertex_color;
197 bool _keep_all_uvsets;
198 bool _convert_cameras;
199 bool _convert_lights;
211 TransformType _transform_type;
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
void add_subset(const GlobPattern &glob)
Adds a name pattern to the list of subset nodes.
bool open_api(bool revert_directory=true)
Attempts to open the Maya API if it was not already open, and returns true if successful, or false if there is an error.
void clear_subsets()
Empties the list of subset nodes added via add_subset().
static TransformType string_transform_type(const string &arg)
Returns the TransformType value corresponding to the indicated string, or TT_invalid.
void close_api()
Closes the Maya API, if it was previously opened.
Describes a complete tree of maya nodes for conversion.
A base class for nodes in the hierarchy that are not leaf nodes.
Defines a texture map that may be applied to geometry.
bool ignore_slider(const string &name) const
Returns true if the indicated name is on the list of sliders to ignore, false otherwise.
virtual DistanceUnit get_input_units()
This may be called after convert_file() has been called and returned true, indicating a successful co...
bool convert_maya()
Fills up the egg_data structure according to the global maya model data.
This is a collection of textures by TRef name.
Collects the set of MayaShaders that have been encountered so far.
void clear()
Frees all of the Maya pointers kept within this object, in preparation for loading a new scene or rel...
virtual string get_additional_extensions() const
Returns a space-separated list of extension, in addition to the one returned by get_extension(), that are recognized by this converter.
This is the primary interface into all the egg data, and the root of the egg file structure...
bool force_joint(const string &name) const
Returns true if the indicated name is on the list of DAG nodes to treat as a joint, false otherwise.
void clear_force_joints()
Empties the list of force_joints added via add_force_joint().
This is our own Panda specialization on the default STL vector.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
void clear_excludes()
Empties the list of excluded nodes added via add_exclude().
virtual string get_extension() const
Returns the common extension of the file type this converter supports.
Describes a single instance of a node in the Maya scene graph, relating it to the corresponding egg s...
The name of a file, such as a texture file or an Egg file.
This defines the various attributes that Maya may associate with the "color" channel for a particular...
void clear_ignore_sliders()
Empties the list of ignore_sliders added via add_ignore_slider().
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...
virtual string get_name() const
Returns the English name of the file type this converter supports.
Corresponds to a single "shader" in Maya.
A parametric NURBS curve.
void clear_subroots()
Empties the list of subroot nodes added via add_subroot().
This class supervises the construction of an EggData structure from a single Maya file...
This is the base class for all three-component vectors and points.
void add_force_joint(const GlobPattern &glob)
Adds a name pattern to the list of force_joints.
void set_from_selection(bool from_selection)
Sets the flag that indicates whether the currently selected Maya geometry will be converted...
This is a base class for a family of converter classes that manage a conversion from some file type t...
void add_subroot(const GlobPattern &glob)
Adds a name pattern to the list of subroot nodes.
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
A collection of vertices.
This class presents a wrapper around the global Maya interface.
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.
This class can be used to test for string matches against standard Unix-shell filename globbing conve...
void add_exclude(const GlobPattern &glob)
Adds a name pattern to the list of excluded nodes.