mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -04:00
Deleting dead code
This commit is contained in:
parent
c035bc7665
commit
c9c32af2ab
@ -1 +0,0 @@
|
|||||||
char Logger::dummy[65536];
|
|
@ -1,56 +0,0 @@
|
|||||||
#ifndef __maxLogger__H
|
|
||||||
#define __maxLogger__H
|
|
||||||
|
|
||||||
class Logger
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum SystemAspectType
|
|
||||||
{
|
|
||||||
SAT_NONE = 0x0000,
|
|
||||||
SAT_NULL_ERROR = 0x0001,
|
|
||||||
SAT_CRITICAL_ERROR = 0x0002,
|
|
||||||
SAT_PARAMETER_INVALID_ERROR = 0x0004,
|
|
||||||
SAT_OTHER_ERROR = 0x0008,
|
|
||||||
SAT_HIGH_LEVEL = 0x0010,
|
|
||||||
SAT_MEDIUM_LEVEL = 0x0020,
|
|
||||||
SAT_LOW_LEVEL = 0x0040,
|
|
||||||
SAT_DEBUG_SPAM_LEVEL = 0x0080,
|
|
||||||
SAT_ALL = 0x00FF
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SystemType
|
|
||||||
{
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM1 = 0x0000,
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM2 = 0x0001,
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM3 = 0x0002,
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM4 = 0x0003,
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM5 = 0x0004,
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM6 = 0x0005,
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM7 = 0x0006,
|
|
||||||
ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM8 = 0x0007
|
|
||||||
};
|
|
||||||
|
|
||||||
enum LoggingPipeType
|
|
||||||
{
|
|
||||||
PIPE_TO_FILE, PIPE_TO_COUT, PIPE_TO_CERR, PIPE_TO_DIALOG_BOX, PIPE_TO_DEV_NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
Logger() {}
|
|
||||||
Logger( LoggingPipeType toWhere, char *additionalStringInfo ) { }
|
|
||||||
~Logger() { }
|
|
||||||
static void FunctionEntry( char *newFunctionName ) { }
|
|
||||||
static void FunctionExit() { }
|
|
||||||
static int GetHierarchyLevel() { }
|
|
||||||
static char * GetLogString() { return dummy; }
|
|
||||||
static void Log( SystemType whichSystem, SystemAspectType whichErrorKind, char *errorDescription ) { }
|
|
||||||
static void SetCurrentFunctionName( char *newFunctionName ) { }
|
|
||||||
static void SetHierarchyLevel( unsigned int newIndentLevel ) { }
|
|
||||||
static void SetOneErrorMask( SystemType whichType, long int whichErrors ) { }
|
|
||||||
static void SetPipe( LoggingPipeType toWhere, char *additionalStringInfo ) { }
|
|
||||||
|
|
||||||
static char dummy[65536];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
@ -73,7 +73,6 @@ from_INode(INode *max_node) {
|
|||||||
((c->ClassID() == BIPSLAVE_CONTROL_CLASS_ID) ||
|
((c->ClassID() == BIPSLAVE_CONTROL_CLASS_ID) ||
|
||||||
(c->ClassID() == BIPBODY_CONTROL_CLASS_ID) ||
|
(c->ClassID() == BIPBODY_CONTROL_CLASS_ID) ||
|
||||||
(c->ClassID() == FOOTPRINT_CLASS_ID)))) {
|
(c->ClassID() == FOOTPRINT_CLASS_ID)))) {
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Found a joint." );
|
|
||||||
|
|
||||||
// This node is a joint.
|
// This node is a joint.
|
||||||
_joint_type = JT_node_joint;
|
_joint_type = JT_node_joint;
|
||||||
|
@ -109,9 +109,6 @@ build_complete_hierarchy(INode *root, ULONG *selection_list, int len) {
|
|||||||
_root->check_pseudo_joints(false);
|
_root->check_pseudo_joints(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL,
|
|
||||||
"finished building complete hierarchy" );
|
|
||||||
|
|
||||||
return all_ok;
|
return all_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,9 +14,6 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#define MNEG Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM2
|
|
||||||
#define MNEG_GEOMETRY_GENERATION Logger::ST_MAP_ME_TO_APP_SPECIFIC_SYSTEM3
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: MaxToEggConverter::Constructor
|
// Function: MaxToEggConverter::Constructor
|
||||||
// Access: Public
|
// Access: Public
|
||||||
@ -96,11 +93,10 @@ bool MaxToEggConverter::convert(MaxEggOptions *options) {
|
|||||||
switch (_options->_anim_type) {
|
switch (_options->_anim_type) {
|
||||||
case MaxEggOptions::AT_pose:
|
case MaxEggOptions::AT_pose:
|
||||||
// pose: set to a specific frame, then get out the static geometry.
|
// pose: set to a specific frame, then get out the static geometry.
|
||||||
sprintf(Logger::GetLogString(), "Extracting geometry from frame #%d.",
|
// sprintf(Logger::GetLogString(), "Extracting geometry from frame #%d.", start_frame);
|
||||||
start_frame);
|
// Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, Logger::GetLogString() );
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, Logger::GetLogString() );
|
// Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Converting static model." );
|
||||||
_current_frame = start_frame;
|
_current_frame = start_frame;
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Converting static model." );
|
|
||||||
all_ok = convert_hierarchy(_egg_data);
|
all_ok = convert_hierarchy(_egg_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -195,22 +191,10 @@ convert_char_chan(double start_frame, double end_frame, double frame_inc,
|
|||||||
int num_nodes = _tree.get_num_nodes();
|
int num_nodes = _tree.get_num_nodes();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sprintf(Logger::GetLogString(),
|
|
||||||
"sf %lf ef %lf inc %lf ofr %lf.",
|
|
||||||
start_frame, end_frame, frame_inc, output_frame_rate );
|
|
||||||
Logger::Log(MNEG_GEOMETRY_GENERATION, Logger::SAT_LOW_LEVEL,
|
|
||||||
Logger::GetLogString() );
|
|
||||||
|
|
||||||
TimeValue frame = start_frame;
|
TimeValue frame = start_frame;
|
||||||
TimeValue frame_stop = end_frame;
|
TimeValue frame_stop = end_frame;
|
||||||
while (frame <= frame_stop) {
|
while (frame <= frame_stop) {
|
||||||
_current_frame = frame;
|
_current_frame = frame;
|
||||||
sprintf(Logger::GetLogString(),
|
|
||||||
"Current frame: %lf.",
|
|
||||||
_current_frame );
|
|
||||||
Logger::Log(MNEG_GEOMETRY_GENERATION, Logger::SAT_LOW_LEVEL,
|
|
||||||
Logger::GetLogString() );
|
|
||||||
|
|
||||||
for (i = 0; i < num_nodes; i++) {
|
for (i = 0; i < num_nodes; i++) {
|
||||||
// Find all joints in the hierarchy
|
// Find all joints in the hierarchy
|
||||||
MaxNodeDesc *node_desc = _tree.get_node(i);
|
MaxNodeDesc *node_desc = _tree.get_node(i);
|
||||||
@ -311,18 +295,13 @@ process_model_node(MaxNodeDesc *node_desc) {
|
|||||||
Mesh max_mesh;
|
Mesh max_mesh;
|
||||||
//Call the correct exporter based on what type of object this is.
|
//Call the correct exporter based on what type of object this is.
|
||||||
switch( state.obj->SuperClassID() ){
|
switch( state.obj->SuperClassID() ){
|
||||||
//A geometric object.
|
|
||||||
case GEOMOBJECT_CLASS_ID:
|
case GEOMOBJECT_CLASS_ID:
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL,
|
|
||||||
"Found a geometric object in the hierarchy!" );
|
|
||||||
egg_group = _tree.get_egg_group(node_desc);
|
egg_group = _tree.get_egg_group(node_desc);
|
||||||
get_transform(max_node, egg_group);
|
get_transform(max_node, egg_group);
|
||||||
|
|
||||||
//Try converting this geometric object to a mesh we can use.
|
//Try converting this geometric object to a mesh we can use.
|
||||||
if (!state.obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) {
|
if (!state.obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) {
|
||||||
Logger::Log(MTEC, Logger::SAT_OTHER_ERROR,
|
|
||||||
"Cannot create geometry from state.obj!");
|
|
||||||
// Logger::FunctionExit();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Convert our state object to a TriObject.
|
//Convert our state object to a TriObject.
|
||||||
@ -333,9 +312,6 @@ process_model_node(MaxNodeDesc *node_desc) {
|
|||||||
|
|
||||||
//Now, get the mesh.
|
//Now, get the mesh.
|
||||||
max_mesh = myMaxTriObject->GetMesh();
|
max_mesh = myMaxTriObject->GetMesh();
|
||||||
Logger::Log( MTEC, Logger::SAT_LOW_LEVEL,
|
|
||||||
"TriObject attached and mesh generated!" );
|
|
||||||
|
|
||||||
make_polyset(max_node, &max_mesh, egg_group);
|
make_polyset(max_node, &max_mesh, egg_group);
|
||||||
|
|
||||||
if (myMaxTriObject != state.obj)
|
if (myMaxTriObject != state.obj)
|
||||||
@ -344,8 +320,6 @@ process_model_node(MaxNodeDesc *node_desc) {
|
|||||||
|
|
||||||
case SHAPE_CLASS_ID:
|
case SHAPE_CLASS_ID:
|
||||||
if (state.obj->ClassID() == EDITABLE_SURF_CLASS_ID) {
|
if (state.obj->ClassID() == EDITABLE_SURF_CLASS_ID) {
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL,
|
|
||||||
"Found a NURB object in the hierarchy!" );
|
|
||||||
NURBSSet getSet;
|
NURBSSet getSet;
|
||||||
if (GetNURBSSet(state.obj, time, getSet, TRUE)) {
|
if (GetNURBSSet(state.obj, time, getSet, TRUE)) {
|
||||||
NURBSObject *nObj = getSet.GetNURBSObject(0);
|
NURBSObject *nObj = getSet.GetNURBSObject(0);
|
||||||
@ -361,118 +335,18 @@ process_model_node(MaxNodeDesc *node_desc) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CAMERA_CLASS_ID:
|
case CAMERA_CLASS_ID:
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL,
|
|
||||||
"Found a camera object in the hierarchy!" );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LIGHT_CLASS_ID:
|
case LIGHT_CLASS_ID:
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL,
|
|
||||||
"Found a light object in the hierarchy!" );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HELPER_CLASS_ID:
|
case HELPER_CLASS_ID:
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL,
|
|
||||||
"Found a helper object in the hierarchy!" );
|
|
||||||
break;
|
break;
|
||||||
/* default:
|
|
||||||
char buf[1024];
|
|
||||||
sprintf(buf, "Unknown Superclass ID: %x, ClassID: %x,%x", state.obj->SuperClassID(),
|
|
||||||
state.obj->ClassID().PartA(), state.obj->ClassID().PartB());
|
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL,
|
|
||||||
buf ); */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// *** Check if any of these Maya options have a Max equivalent
|
|
||||||
/*
|
|
||||||
} else if (dag_node.inUnderWorld()) {
|
|
||||||
if (mayaegg_cat.is_debug()) {
|
|
||||||
mayaegg_cat.debug()
|
|
||||||
<< "Ignoring underworld node " << path
|
|
||||||
<< "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (dag_node.isIntermediateObject()) {
|
|
||||||
if (mayaegg_cat.is_debug()) {
|
|
||||||
mayaegg_cat.debug()
|
|
||||||
<< "Ignoring intermediate object " << path
|
|
||||||
<< "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (dag_path.hasFn(MFn::kNurbsSurface)) {
|
|
||||||
EggGroup *egg_group = _tree.get_egg_group(node_desc);
|
|
||||||
get_transform(dag_path, egg_group);
|
|
||||||
|
|
||||||
MFnNurbsSurface surface(dag_path, &status);
|
|
||||||
if (!status) {
|
|
||||||
mayaegg_cat.info()
|
|
||||||
<< "Error in node " << path
|
|
||||||
<< ":\n"
|
|
||||||
<< " it appears to have a NURBS surface, but does not.\n";
|
|
||||||
} else {
|
|
||||||
make_nurbs_surface(dag_path, surface, egg_group);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (dag_path.hasFn(MFn::kNurbsCurve)) {
|
|
||||||
// Only convert NurbsCurves if we aren't making an animated model.
|
|
||||||
// Animated models, as a general rule, don't want these sorts of
|
|
||||||
// things in them.
|
|
||||||
if (_options->_anim_type != MaxEggOptions::AT_model) {
|
|
||||||
EggGroup *egg_group = _tree.get_egg_group(node_desc);
|
|
||||||
get_transform(dag_path, egg_group);
|
|
||||||
|
|
||||||
MFnNurbsCurve curve(dag_path, &status);
|
|
||||||
if (!status) {
|
|
||||||
mayaegg_cat.info()
|
|
||||||
<< "Error in node " << path << ":\n"
|
|
||||||
<< " it appears to have a NURBS curve, but does not.\n";
|
|
||||||
} else {
|
|
||||||
make_nurbs_curve(dag_path, curve, egg_group);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (dag_path.hasFn(MFn::kMesh)) {
|
|
||||||
EggGroup *egg_group = _tree.get_egg_group(node_desc);
|
|
||||||
get_transform(dag_path, egg_group);
|
|
||||||
|
|
||||||
MFnMesh mesh(dag_path, &status);
|
|
||||||
if (!status) {
|
|
||||||
mayaegg_cat.info()
|
|
||||||
<< "Error in node " << path << ":\n"
|
|
||||||
<< " it appears to have a polygon mesh, but does not.\n";
|
|
||||||
} else {
|
|
||||||
make_polyset(dag_path, mesh, egg_group);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (dag_path.hasFn(MFn::kLocator)) {
|
|
||||||
EggGroup *egg_group = _tree.get_egg_group(node_desc);
|
|
||||||
|
|
||||||
if (mayaegg_cat.is_debug()) {
|
|
||||||
mayaegg_cat.debug()
|
|
||||||
<< "Locator at " << path << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Presumably, the locator's position has some meaning to the
|
|
||||||
// end-user, so we will implicitly tag it with the DCS flag so it
|
|
||||||
// won't get flattened out.
|
|
||||||
if (_options->_anim_type != MaxEggOptions::AT_model) {
|
|
||||||
// For now, don't set the DCS flag on locators within
|
|
||||||
// character models, since egg-optchar doesn't understand
|
|
||||||
// this. Perhaps there's no reason to ever change this, since
|
|
||||||
// locators within character models may not be meaningful.
|
|
||||||
egg_group->set_dcs_type(EggGroup::DC_net);
|
|
||||||
}
|
|
||||||
get_transform(dag_path, egg_group);
|
|
||||||
make_locator(dag_path, dag_node, egg_group);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// Just a generic node.
|
|
||||||
EggGroup *egg_group = _tree.get_egg_group(node_desc);
|
|
||||||
get_transform(dag_path, egg_group);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,11 +374,7 @@ get_transform(INode *max_node, EggGroup *egg_group) {
|
|||||||
Point3 row2;
|
Point3 row2;
|
||||||
Point3 row3;
|
Point3 row3;
|
||||||
|
|
||||||
Logger::FunctionEntry("MaxNodeEggGroup::ApplyTransformFromMaxNodeToEggGroup");
|
|
||||||
if ( !egg_group ) {
|
if ( !egg_group ) {
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_NULL_ERROR,
|
|
||||||
"Destination EggGroup is null!" );
|
|
||||||
Logger::FunctionExit();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -597,13 +467,7 @@ get_transform(INode *max_node, EggGroup *egg_group) {
|
|||||||
m4d = m4d * egg_group->get_node_frame_inv();
|
m4d = m4d * egg_group->get_node_frame_inv();
|
||||||
if (!m4d.almost_equal(LMatrix4d::ident_mat(), 0.0001)) {
|
if (!m4d.almost_equal(LMatrix4d::ident_mat(), 0.0001)) {
|
||||||
egg_group->add_matrix4(m4d);
|
egg_group->add_matrix4(m4d);
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_DEBUG_SPAM_LEVEL,
|
|
||||||
"Non-identity matrix applied to node!" );
|
|
||||||
} else {
|
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_DEBUG_SPAM_LEVEL,
|
|
||||||
"Resultant matrix too close to identity; no transformation applied!" );
|
|
||||||
}
|
}
|
||||||
Logger::FunctionExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -625,8 +489,6 @@ get_object_transform(INode *max_node) {
|
|||||||
Point3 row2;
|
Point3 row2;
|
||||||
Point3 row3;
|
Point3 row3;
|
||||||
|
|
||||||
Logger::FunctionEntry("MaxNodeEggGroup::ApplyTransformFromMaxNodeToEggGroup");
|
|
||||||
|
|
||||||
// Gets the TM for this node, a matrix which encapsulates all transformations
|
// Gets the TM for this node, a matrix which encapsulates all transformations
|
||||||
// it takes to get to the current node, including parent transformations.
|
// it takes to get to the current node, including parent transformations.
|
||||||
pivot = max_node->GetObjectTM(_current_frame * GetTicksPerFrame());
|
pivot = max_node->GetObjectTM(_current_frame * GetTicksPerFrame());
|
||||||
@ -639,7 +501,6 @@ get_object_transform(INode *max_node) {
|
|||||||
row1.x, row1.y, row1.z, 0.0f,
|
row1.x, row1.y, row1.z, 0.0f,
|
||||||
row2.x, row2.y, row2.z, 0.0f,
|
row2.x, row2.y, row2.z, 0.0f,
|
||||||
row3.x, row3.y, row3.z, 1.0f );
|
row3.x, row3.y, row3.z, 1.0f );
|
||||||
Logger::FunctionExit();
|
|
||||||
return m4d;
|
return m4d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,11 +527,7 @@ get_joint_transform(INode *max_node, EggGroup *egg_group) {
|
|||||||
Point3 row2;
|
Point3 row2;
|
||||||
Point3 row3;
|
Point3 row3;
|
||||||
|
|
||||||
Logger::FunctionEntry("MaxNodeEggGroup::ApplyTransformFromMaxNodeToEggGroup");
|
|
||||||
if ( !egg_group ) {
|
if ( !egg_group ) {
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_NULL_ERROR,
|
|
||||||
"Destination EggGroup is null!" );
|
|
||||||
Logger::FunctionExit();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -693,13 +550,7 @@ get_joint_transform(INode *max_node, EggGroup *egg_group) {
|
|||||||
m4d = m4d * egg_group->get_node_frame_inv();
|
m4d = m4d * egg_group->get_node_frame_inv();
|
||||||
if (!m4d.almost_equal(LMatrix4d::ident_mat(), 0.0001)) {
|
if (!m4d.almost_equal(LMatrix4d::ident_mat(), 0.0001)) {
|
||||||
egg_group->add_matrix4(m4d);
|
egg_group->add_matrix4(m4d);
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_DEBUG_SPAM_LEVEL,
|
|
||||||
"Non-identity matrix applied to node!" );
|
|
||||||
} else {
|
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_DEBUG_SPAM_LEVEL,
|
|
||||||
"Resultant matrix too close to identity; no transformation applied!" );
|
|
||||||
}
|
}
|
||||||
Logger::FunctionExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -726,11 +577,7 @@ get_joint_transform(INode *max_node, INode *parent_node, EggGroup *egg_group) {
|
|||||||
Point3 row2;
|
Point3 row2;
|
||||||
Point3 row3;
|
Point3 row3;
|
||||||
|
|
||||||
Logger::FunctionEntry("MaxNodeEggGroup::ApplyTransformFromMaxNodeToEggGroup");
|
|
||||||
if ( !egg_group ) {
|
if ( !egg_group ) {
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_NULL_ERROR,
|
|
||||||
"Destination EggGroup is null!" );
|
|
||||||
Logger::FunctionExit();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,13 +616,7 @@ if (parent_node) {
|
|||||||
}
|
}
|
||||||
if (!m4d.almost_equal(LMatrix4d::ident_mat(), 0.0001)) {
|
if (!m4d.almost_equal(LMatrix4d::ident_mat(), 0.0001)) {
|
||||||
egg_group->add_matrix4(m4d);
|
egg_group->add_matrix4(m4d);
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_DEBUG_SPAM_LEVEL,
|
|
||||||
"Non-identity matrix applied to node!" );
|
|
||||||
} else {
|
|
||||||
Logger::Log( MNEG_GEOMETRY_GENERATION, Logger::SAT_DEBUG_SPAM_LEVEL,
|
|
||||||
"Resultant matrix too close to identity; no transformation applied!" );
|
|
||||||
}
|
}
|
||||||
Logger::FunctionExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -795,9 +636,6 @@ make_nurbs_curve(NURBSCVCurve *curve, const string &name,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (knots != cvs + degree) {
|
if (knots != cvs + degree) {
|
||||||
char buf[1024];
|
|
||||||
sprintf(buf, "NURBS knots count incorrect. Order %d, CVs %d, knots %d", degree, cvs, knots);
|
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL, buf);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -819,7 +657,6 @@ make_nurbs_curve(NURBSCVCurve *curve, const string &name,
|
|||||||
if (!cv) {
|
if (!cv) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf, "Error getting CV %d", i);
|
sprintf(buf, "Error getting CV %d", i);
|
||||||
Logger::Log( MTEC, Logger::SAT_HIGH_LEVEL, buf);
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
EggVertex vert;
|
EggVertex vert;
|
||||||
@ -844,7 +681,6 @@ make_nurbs_curve(NURBSCVCurve *curve, const string &name,
|
|||||||
void MaxToEggConverter::
|
void MaxToEggConverter::
|
||||||
make_polyset(INode *max_node, Mesh *mesh,
|
make_polyset(INode *max_node, Mesh *mesh,
|
||||||
EggGroup *egg_group, Shader *default_shader) {
|
EggGroup *egg_group, Shader *default_shader) {
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Entered make_poly_set." );
|
|
||||||
|
|
||||||
// *** I think this needs to have a plugin written to support
|
// *** I think this needs to have a plugin written to support
|
||||||
/*
|
/*
|
||||||
@ -856,8 +692,6 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
mesh->buildNormals();
|
mesh->buildNormals();
|
||||||
|
|
||||||
if (mesh->getNumFaces() == 0) {
|
if (mesh->getNumFaces() == 0) {
|
||||||
Logger::Log(MNEG_GEOMETRY_GENERATION, Logger::SAT_MEDIUM_LEVEL,
|
|
||||||
"Ignoring empty mesh ");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -895,10 +729,8 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
// will be identity; but if the node is under an instance
|
// will be identity; but if the node is under an instance
|
||||||
// (particularly, for instance, a billboard) then the vertex space
|
// (particularly, for instance, a billboard) then the vertex space
|
||||||
// will be different from world space.
|
// will be different from world space.
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Before obtaining transform." );
|
|
||||||
LMatrix4d vertex_frame = get_object_transform(max_node) *
|
LMatrix4d vertex_frame = get_object_transform(max_node) *
|
||||||
egg_group->get_vertex_frame_inv();
|
egg_group->get_vertex_frame_inv();
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "After obtaining transform." );
|
|
||||||
|
|
||||||
|
|
||||||
// *** Not quite sure how this vertex color flag is handled. Check on later
|
// *** Not quite sure how this vertex color flag is handled. Check on later
|
||||||
@ -913,7 +745,6 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
for ( int iFace=0; iFace < mesh->getNumFaces(); iFace++ ) {
|
for ( int iFace=0; iFace < mesh->getNumFaces(); iFace++ ) {
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Getting face." );
|
|
||||||
EggPolygon *egg_poly = new EggPolygon;
|
EggPolygon *egg_poly = new EggPolygon;
|
||||||
egg_group->add_child(egg_poly);
|
egg_group->add_child(egg_poly);
|
||||||
|
|
||||||
@ -978,11 +809,7 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Get the vertices for the polygon.
|
// Get the vertices for the polygon.
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Before getting vertices." );
|
|
||||||
|
|
||||||
for ( int iVertex=0; iVertex < 3; iVertex++ ) {
|
for ( int iVertex=0; iVertex < 3; iVertex++ ) {
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Getting vertex." );
|
|
||||||
|
|
||||||
EggVertex vert;
|
EggVertex vert;
|
||||||
|
|
||||||
// Get the vertex position
|
// Get the vertex position
|
||||||
@ -990,8 +817,6 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
LPoint3d p3d(vertex.x, vertex.y, vertex.z);
|
LPoint3d p3d(vertex.x, vertex.y, vertex.z);
|
||||||
p3d = p3d * vertex_frame;
|
p3d = p3d * vertex_frame;
|
||||||
vert.set_pos(p3d);
|
vert.set_pos(p3d);
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "After getting vertex pos before getting normal." );
|
|
||||||
|
|
||||||
|
|
||||||
// Get the vertex normal
|
// Get the vertex normal
|
||||||
Point3 normal = get_max_vertex_normal(mesh, iFace, iVertex);
|
Point3 normal = get_max_vertex_normal(mesh, iFace, iVertex);
|
||||||
@ -1000,7 +825,6 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
// explain why normals were weird previously
|
// explain why normals were weird previously
|
||||||
n3d = n3d * vertex_frame;
|
n3d = n3d * vertex_frame;
|
||||||
vert.set_normal(n3d);
|
vert.set_normal(n3d);
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "After getting normal." );
|
|
||||||
|
|
||||||
// *** More shader stuff to ignore for now
|
// *** More shader stuff to ignore for now
|
||||||
/*
|
/*
|
||||||
@ -1025,14 +849,7 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
if (mesh->getNumTVerts()) {
|
if (mesh->getNumTVerts()) {
|
||||||
UVVert vertTexCoord = mesh->getTVert(mesh->tvFace[iFace].t[iVertex]);
|
UVVert vertTexCoord = mesh->getTVert(mesh->tvFace[iFace].t[iVertex]);
|
||||||
vert.set_uv( TexCoordd(vertTexCoord.x, vertTexCoord.y));
|
vert.set_uv( TexCoordd(vertTexCoord.x, vertTexCoord.y));
|
||||||
sprintf(Logger::GetLogString(),
|
|
||||||
"Got tex vertex %d of %d from local tex data.",
|
|
||||||
iVertex, mesh->getNumTVerts() );
|
|
||||||
Logger::Log(MNEG_GEOMETRY_GENERATION, Logger::SAT_LOW_LEVEL,
|
|
||||||
Logger::GetLogString() );
|
|
||||||
}
|
}
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "after getting TVerts." );
|
|
||||||
|
|
||||||
|
|
||||||
// *** Leaving out vertex colors for now
|
// *** Leaving out vertex colors for now
|
||||||
/*
|
/*
|
||||||
@ -1052,7 +869,6 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
egg_poly->add_vertex(vpool->create_unique_vertex(vert));
|
egg_poly->add_vertex(vpool->create_unique_vertex(vert));
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Fixing windings" );
|
|
||||||
//Max uses normals, not winding, to determine which way a
|
//Max uses normals, not winding, to determine which way a
|
||||||
//polygon faces. Make sure the winding and that normal agree
|
//polygon faces. Make sure the winding and that normal agree
|
||||||
EggVertex *verts[3];
|
EggVertex *verts[3];
|
||||||
@ -1081,7 +897,6 @@ make_polyset(INode *max_node, Mesh *mesh,
|
|||||||
set_shader_attributes(*egg_poly, *shader);
|
set_shader_attributes(*egg_poly, *shader);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, "Before set_material_attributes" );
|
|
||||||
|
|
||||||
set_material_attributes(*egg_poly, max_node->GetMtl(), &face);
|
set_material_attributes(*egg_poly, max_node->GetMtl(), &face);
|
||||||
}
|
}
|
||||||
@ -1241,8 +1056,6 @@ get_vertex_weights(INode *max_node, EggVertexPool *vpool) {
|
|||||||
EggGroup *joint = _tree.get_egg_group(joint_node_desc);
|
EggGroup *joint = _tree.get_egg_group(joint_node_desc);
|
||||||
if (joint != (EggGroup *)NULL)
|
if (joint != (EggGroup *)NULL)
|
||||||
joint->ref_vertex(vert, 1.0f);
|
joint->ref_vertex(vert, 1.0f);
|
||||||
else
|
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, bone_node->GetName() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(vertexType == RIGID_BLENDED_TYPE) {
|
else if(vertexType == RIGID_BLENDED_TYPE) {
|
||||||
@ -1258,8 +1071,6 @@ get_vertex_weights(INode *max_node, EggVertexPool *vpool) {
|
|||||||
EggGroup *joint = _tree.get_egg_group(joint_node_desc);
|
EggGroup *joint = _tree.get_egg_group(joint_node_desc);
|
||||||
if (joint != (EggGroup *)NULL)
|
if (joint != (EggGroup *)NULL)
|
||||||
joint->ref_vertex(vert, weight);
|
joint->ref_vertex(vert, weight);
|
||||||
else
|
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, bone_node->GetName() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1296,8 +1107,6 @@ get_vertex_weights(INode *max_node, EggVertexPool *vpool) {
|
|||||||
EggGroup *joint = _tree.get_egg_group(joint_node_desc);
|
EggGroup *joint = _tree.get_egg_group(joint_node_desc);
|
||||||
if (joint != (EggGroup *)NULL) {
|
if (joint != (EggGroup *)NULL) {
|
||||||
joint->ref_vertex(vert, weight);
|
joint->ref_vertex(vert, weight);
|
||||||
} else {
|
|
||||||
Logger::Log( MTEC, Logger::SAT_MEDIUM_LEVEL, bone_node->GetName() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1455,13 +1264,9 @@ set_material_attributes(EggPrimitive &primitive, Mtl *maxMaterial, Face *face) {
|
|||||||
|
|
||||||
Point3 diffuseColor = Point3(1, 1, 1);
|
Point3 diffuseColor = Point3(1, 1, 1);
|
||||||
|
|
||||||
Logger::FunctionEntry( "MaxToEggConverter::CreateEggTextureFromINode" );
|
|
||||||
|
|
||||||
//First, get the material data associated with this node.
|
//First, get the material data associated with this node.
|
||||||
// maxMaterial = max_node->GetMtl();
|
// maxMaterial = max_node->GetMtl();
|
||||||
if ( !maxMaterial ) {
|
if ( !maxMaterial ) {
|
||||||
Logger::Log(MTEC, Logger::SAT_NULL_ERROR, "maxMaterial is null!");
|
|
||||||
Logger::FunctionExit();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1537,20 +1342,13 @@ set_material_attributes(EggPrimitive &primitive, Mtl *maxMaterial, Face *face) {
|
|||||||
MtlID matID = face->getMatID();
|
MtlID matID = face->getMatID();
|
||||||
if (matID < maxMaterial->NumSubMtls()) {
|
if (matID < maxMaterial->NumSubMtls()) {
|
||||||
set_material_attributes(primitive, maxMaterial->GetSubMtl(matID), face);
|
set_material_attributes(primitive, maxMaterial->GetSubMtl(matID), face);
|
||||||
} else {
|
|
||||||
sprintf(Logger::GetLogString(),
|
|
||||||
"SubMaterial ID %d is greater than the total submaterial for this material",
|
|
||||||
matID);
|
|
||||||
Logger::Log(MTEC, Logger::SAT_NULL_ERROR, "maxMaterial is null!");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// It's non-standard material. At the moment, let's just
|
// It's non-standard material. At the moment, let's just
|
||||||
// return
|
// return
|
||||||
Logger::FunctionExit();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::FunctionExit();
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1577,13 +1375,9 @@ set_material_attributes(EggPrimitive &primitive, Mtl *maxMaterial, Face *face) {
|
|||||||
|
|
||||||
Point3 diffuseColor = Point3(1, 1, 1);
|
Point3 diffuseColor = Point3(1, 1, 1);
|
||||||
|
|
||||||
Logger::FunctionEntry( "MaxToEggConverter::CreateEggTextureFromINode" );
|
|
||||||
|
|
||||||
//First, get the material data associated with this node.
|
//First, get the material data associated with this node.
|
||||||
// maxMaterial = max_node->GetMtl();
|
// maxMaterial = max_node->GetMtl();
|
||||||
if ( !maxMaterial ) {
|
if ( !maxMaterial ) {
|
||||||
Logger::Log(MTEC, Logger::SAT_NULL_ERROR, "maxMaterial is null!");
|
|
||||||
Logger::FunctionExit();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1695,20 +1489,12 @@ set_material_attributes(EggPrimitive &primitive, Mtl *maxMaterial, Face *face) {
|
|||||||
MtlID matID = face->getMatID();
|
MtlID matID = face->getMatID();
|
||||||
if (matID < maxMaterial->NumSubMtls()) {
|
if (matID < maxMaterial->NumSubMtls()) {
|
||||||
set_material_attributes(primitive, maxMaterial->GetSubMtl(matID), face);
|
set_material_attributes(primitive, maxMaterial->GetSubMtl(matID), face);
|
||||||
} else {
|
|
||||||
sprintf(Logger::GetLogString(),
|
|
||||||
"SubMaterial ID %d is greater than the total submaterial for this material",
|
|
||||||
matID);
|
|
||||||
Logger::Log(MTEC, Logger::SAT_NULL_ERROR, "maxMaterial is null!");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// It's another non-standard material. At the moment, let's just
|
// It's another non-standard material. At the moment, let's just
|
||||||
// return
|
// return
|
||||||
Logger::FunctionExit();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::FunctionExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -1895,8 +1681,7 @@ Modifier* MaxToEggConverter::FindSkinModifier (INode* node, const Class_ID &type
|
|||||||
if (!pObj) return NULL;
|
if (!pObj) return NULL;
|
||||||
|
|
||||||
// Is derived object ?
|
// Is derived object ?
|
||||||
while (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
|
while (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID) {
|
||||||
{
|
|
||||||
// Yes -> Cast.
|
// Yes -> Cast.
|
||||||
IDerivedObject* pDerObj = static_cast<IDerivedObject*>(pObj);
|
IDerivedObject* pDerObj = static_cast<IDerivedObject*>(pObj);
|
||||||
|
|
||||||
|
@ -47,14 +47,12 @@
|
|||||||
|
|
||||||
#include "maxNodeDesc.h"
|
#include "maxNodeDesc.h"
|
||||||
#include "maxNodeTree.h"
|
#include "maxNodeTree.h"
|
||||||
#include "maxLogger.h"
|
|
||||||
#include "maxToEgg.h"
|
#include "maxToEgg.h"
|
||||||
#include "maxEggExpOptions.h"
|
#include "maxEggExpOptions.h"
|
||||||
#include "maxToEggConverter.h"
|
#include "maxToEggConverter.h"
|
||||||
#include "maxEgg.h"
|
#include "maxEgg.h"
|
||||||
|
|
||||||
#include "maxDllEntry.cxx"
|
#include "maxDllEntry.cxx"
|
||||||
#include "maxLogger.cxx"
|
|
||||||
#include "maxEgg.cxx"
|
#include "maxEgg.cxx"
|
||||||
#include "maxEggExpOptions.cxx"
|
#include "maxEggExpOptions.cxx"
|
||||||
#include "maxNodeDesc.cxx"
|
#include "maxNodeDesc.cxx"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user