Pārlūkot izejas kodu

split out maya and mayaegg

David Rose 23 gadi atpakaļ
vecāks
revīzija
2fad4570e9

+ 20 - 0
pandatool/src/maya/Sources.pp

@@ -0,0 +1,20 @@
+#define DIRECTORY_IF_MAYA yes
+
+#begin ss_lib_target
+  #define USE_MAYA yes
+  #define TARGET maya
+  #define LOCAL_LIBS \
+    converter pandatoolbase
+  #define OTHER_LIBS \
+    putil:c panda:m \
+    express:c pandaexpress:m \
+    dtoolutil:c dtoolbase:c dconfig:c dtoolconfig:m dtool:m pystub
+
+  #define SOURCES \
+    config_maya.cxx config_maya.h \
+    mayaApi.cxx mayaApi.h \
+    maya_funcs.I maya_funcs.cxx maya_funcs.h \
+    post_maya_include.h pre_maya_include.h
+
+#end ss_lib_target
+

+ 46 - 0
pandatool/src/maya/config_maya.cxx

@@ -0,0 +1,46 @@
+// Filename: config_maya.cxx
+// Created by:  drose (15Apr02)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://www.panda3d.org/license.txt .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+#include "config_maya.h"
+
+#include <dconfig.h>
+
+Configure(config_maya);
+NotifyCategoryDef(maya, "");
+
+ConfigureFn(config_maya) {
+  init_libmaya();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: init_libmaya
+//  Description: Initializes the library.  This must be called at
+//               least once before any of the functions or classes in
+//               this library can be used.  Normally it will be
+//               called by the static initializers and need not be
+//               called explicitly, but special cases exist.
+////////////////////////////////////////////////////////////////////
+void
+init_libmaya() {
+  static bool initialized = false;
+  if (initialized) {
+    return;
+  }
+  initialized = true;
+}
+

+ 29 - 0
pandatool/src/maya/config_maya.h

@@ -0,0 +1,29 @@
+// Filename: config_maya.h
+// Created by:  drose (15Apr02)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://www.panda3d.org/license.txt .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+#ifndef CONFIG_MAYA_H
+#define CONFIG_MAYA_H
+
+#include "pandatoolbase.h"
+#include "notifyCategoryProxy.h"
+
+NotifyCategoryDeclNoExport(maya);
+
+extern void init_libmaya();
+
+#endif

+ 2 - 2
pandatool/src/mayaegg/mayaApi.cxx → pandatool/src/maya/mayaApi.cxx

@@ -17,7 +17,7 @@
 ////////////////////////////////////////////////////////////////////
 
 #include "mayaApi.h"
-#include "config_mayaegg.h"
+#include "config_maya.h"
 
 #include "pre_maya_include.h"
 #include <maya/MGlobal.h>
@@ -150,7 +150,7 @@ bool MayaApi::
 read(const Filename &filename) {
   MFileIO::newFile(true);
 
-  mayaegg_cat.info() << "Reading " << filename << "\n";
+  maya_cat.info() << "Reading " << filename << "\n";
   // Load the file into Maya
   string os_filename = filename.to_os_specific();
 

+ 0 - 0
pandatool/src/mayaegg/mayaApi.h → pandatool/src/maya/mayaApi.h


+ 0 - 0
pandatool/src/mayaegg/maya_funcs.I → pandatool/src/maya/maya_funcs.I


+ 3 - 3
pandatool/src/mayaegg/maya_funcs.T → pandatool/src/maya/maya_funcs.T

@@ -30,14 +30,14 @@ get_maya_attribute(MObject &node, const string &attribute_name,
   MStatus status;
   MFnDependencyNode node_fn(node, &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Object is a " << node.apiTypeStr() << ", not a DependencyNode.\n";
     return false;
   }
 
   MObject attr = node_fn.attribute(attribute_name.c_str(), &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Object " << node_fn.name() << " does not support attribute "
       << attribute_name << "\n";
     return false;
@@ -45,7 +45,7 @@ get_maya_attribute(MObject &node, const string &attribute_name,
 
   MFnAttribute attr_fn(attr, &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name << " on " << node_fn.name()
       << " is a " << attr.apiTypeStr() << ", not an Attribute.\n";
     return false;

+ 13 - 13
pandatool/src/mayaegg/maya_funcs.cxx → pandatool/src/maya/maya_funcs.cxx

@@ -36,7 +36,7 @@ bool
 get_bool_attribute(MObject &node, const string &attribute_name,
                    bool &value) {
   if (!get_maya_attribute(node, attribute_name, value)) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name
       << " does not have an bool value.\n";
     describe_maya_attribute(node, attribute_name);
@@ -55,7 +55,7 @@ get_angle_attribute(MObject &node, const string &attribute_name,
                     double &value) {
   MAngle maya_value;
   if (!get_maya_attribute(node, attribute_name, maya_value)) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name
       << " does not have an angle value.\n";
     describe_maya_attribute(node, attribute_name);
@@ -77,7 +77,7 @@ get_vec2f_attribute(MObject &node, const string &attribute_name,
 
   MObject vec2f_object;
   if (!get_maya_attribute(node, attribute_name, vec2f_object)) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name
       << " does not have a vec2f object value.\n";
     describe_maya_attribute(node, attribute_name);
@@ -86,7 +86,7 @@ get_vec2f_attribute(MObject &node, const string &attribute_name,
 
   MFnNumericData data(vec2f_object, &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name << " is of type "
       << vec2f_object.apiTypeStr() << ", not a NumericData.\n";
     return false;
@@ -94,7 +94,7 @@ get_vec2f_attribute(MObject &node, const string &attribute_name,
 
   status = data.getData(value[0], value[1]);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Unable to extract 2 floats from " << attribute_name
       << ", of type " << vec2f_object.apiTypeStr() << "\n";
   }
@@ -114,7 +114,7 @@ get_vec2d_attribute(MObject &node, const string &attribute_name,
 
   MObject vec2d_object;
   if (!get_maya_attribute(node, attribute_name, vec2d_object)) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name
       << " does not have a vec2d object value.\n";
     describe_maya_attribute(node, attribute_name);
@@ -123,7 +123,7 @@ get_vec2d_attribute(MObject &node, const string &attribute_name,
 
   MFnNumericData data(vec2d_object, &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name << " is of type "
       << vec2d_object.apiTypeStr() << ", not a NumericData.\n";
     return false;
@@ -131,7 +131,7 @@ get_vec2d_attribute(MObject &node, const string &attribute_name,
 
   status = data.getData(value[0], value[1]);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Unable to extract 2 doubles from " << attribute_name
       << ", of type " << vec2d_object.apiTypeStr() << "\n";
   }
@@ -151,7 +151,7 @@ get_string_attribute(MObject &node, const string &attribute_name,
 
   MObject string_object;
   if (!get_maya_attribute(node, attribute_name, string_object)) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name
       << " does not have an string object value.\n";
     describe_maya_attribute(node, attribute_name);
@@ -160,7 +160,7 @@ get_string_attribute(MObject &node, const string &attribute_name,
 
   MFnStringData data(string_object, &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Attribute " << attribute_name << " is of type "
       << string_object.apiTypeStr() << ", not a StringData.\n";
     return false;
@@ -180,20 +180,20 @@ describe_maya_attribute(MObject &node, const string &attribute_name) {
   MStatus status;
   MFnDependencyNode node_fn(node, &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Object is a " << node.apiTypeStr() << ", not a DependencyNode.\n";
     return;
   }
 
   MObject attr = node_fn.attribute(attribute_name.c_str(), &status);
   if (!status) {
-    mayaegg_cat.error()
+    maya_cat.error()
       << "Object " << node_fn.name() << " does not support attribute "
       << attribute_name << "\n";
     return;
   }
 
-  mayaegg_cat.error()
+  maya_cat.error()
     << "Attribute " << attribute_name << " on object "
     << node_fn.name() << " has type " << attr.apiTypeStr() << "\n";
 }

+ 1 - 1
pandatool/src/mayaegg/maya_funcs.h → pandatool/src/maya/maya_funcs.h

@@ -21,7 +21,7 @@
 
 #include "pandatoolbase.h"
 #include "luse.h"
-#include "config_mayaegg.h"
+#include "config_maya.h"
 
 #include "pre_maya_include.h"
 #include <maya/MFnAttribute.h>

+ 0 - 0
pandatool/src/mayaegg/post_maya_include.h → pandatool/src/maya/post_maya_include.h


+ 0 - 0
pandatool/src/mayaegg/pre_maya_include.h → pandatool/src/maya/pre_maya_include.h


+ 2 - 5
pandatool/src/mayaegg/Sources.pp

@@ -4,7 +4,7 @@
   #define USE_MAYA yes
   #define TARGET mayaegg
   #define LOCAL_LIBS \
-    converter pandatoolbase
+    maya converter pandatoolbase
   #define OTHER_LIBS \
     egg:c pandaegg:m \
     linmath:c putil:c panda:m \
@@ -16,12 +16,9 @@
 
   #define SOURCES \
     config_mayaegg.cxx config_mayaegg.h \
-    mayaApi.cxx mayaApi.h \
     mayaShader.cxx mayaShader.h \
     mayaShaders.cxx mayaShaders.h \
-    mayaToEggConverter.cxx mayaToEggConverter.h \
-    maya_funcs.I maya_funcs.cxx maya_funcs.h \
-    post_maya_include.h pre_maya_include.h
+    mayaToEggConverter.cxx mayaToEggConverter.h
 
 #end ss_lib_target
 

+ 1 - 1
pandatool/src/mayaegg/config_mayaegg.cxx

@@ -21,7 +21,7 @@
 #include <dconfig.h>
 
 Configure(config_mayaegg);
-NotifyCategoryDef(mayaegg, "");
+NotifyCategoryDef(mayaegg, ":maya");
 
 ConfigureFn(config_mayaegg) {
   init_libmayaegg();

+ 1 - 1
pandatool/src/mayaprogs/Sources.pp

@@ -25,7 +25,7 @@
   #define USE_MAYA yes
   #define TARGET $[binary_name]
   #define LOCAL_LIBS \
-    mayaegg eggbase progbase
+    mayaegg maya eggbase progbase
   #define OTHER_LIBS \
     egg:c pandaegg:m \
     linmath:c putil:c panda:m \