Browse Source

uv scrolling support for maya

Zachary Pavlov 16 years ago
parent
commit
3ea111343a
2 changed files with 16 additions and 1 deletions
  1. 9 1
      panda/src/egg2pg/eggLoader.cxx
  2. 7 0
      pandatool/src/mayaegg/mayaNodeTree.cxx

+ 9 - 1
panda/src/egg2pg/eggLoader.cxx

@@ -90,6 +90,7 @@
 #include "sparseArray.h"
 #include "bitArray.h"
 #include "thread.h"
+#include "uvScrollNode.h"
 
 #include <ctype.h>
 #include <algorithm>
@@ -1878,7 +1879,14 @@ make_node(EggGroup *egg_group, PandaNode *parent) {
     for (ci = egg_group->begin(); ci != egg_group->end(); ++ci) {
       make_node(*ci, node);
     }
-
+  } else if (egg_group->has_scrolling_uvs()) {
+    node = new UvScrollNode(egg_group->get_name(), egg_group->get_scroll_u(), egg_group->get_scroll_v());
+    
+    EggGroup::const_iterator ci;
+    for (ci = egg_group->begin(); ci != egg_group->end(); ++ci) {
+      make_node(*ci, node);
+    }
+    
   } else if (egg_group->get_model_flag() || egg_group->has_dcs_type()) {
     // A model or DCS flag; create a model node.
     node = new ModelNode(egg_group->get_name());

+ 7 - 0
pandatool/src/mayaegg/mayaNodeTree.cxx

@@ -381,6 +381,7 @@ get_egg_group(MayaNodeDesc *node_desc) {
       // Check for an object type setting, from Oliver's plug-in.
       MObject dag_object = node_desc->get_dag_path().node();
       string object_type;
+      LVector3d value(3,0,0);
       if (get_enum_attribute(dag_object, "eggObjectTypes1", object_type)) {
         egg_group->add_object_type(object_type);
       }
@@ -390,6 +391,12 @@ get_egg_group(MayaNodeDesc *node_desc) {
       if (get_enum_attribute(dag_object, "eggObjectTypes3", object_type)) {
         egg_group->add_object_type(object_type);
       }
+
+      if(get_vec3d_attribute(dag_object, "scrollUV", value)) {
+        egg_group->set_scroll_u(value[0]);
+        egg_group->set_scroll_v(value[1]);
+      }
+      
       pvector<string> tag_attribute_names;
       get_tag_attribute_names(dag_object, tag_attribute_names);
       for (uint ti=0; ti < tag_attribute_names.size(); ti++) {