Explorar el Código

support fullpath for inline loading of .mb files

David Rose hace 23 años
padre
commit
6bd4de3946
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      pandatool/src/mayaegg/mayaToEggConverter.cxx

+ 6 - 2
pandatool/src/mayaegg/mayaToEggConverter.cxx

@@ -1577,8 +1577,12 @@ set_shader_attributes(EggPrimitive &primitive, const MayaShader &shader) {
   // if present, replaces the color.
 
   if (shader._has_texture) {
-    Filename pathname = convert_texture_path(shader._texture);
-    EggTexture tex(shader._name, pathname);
+    Filename filename = Filename::from_os_specific(shader._texture);
+    Filename fullpath = 
+      _path_replace->match_path(filename, get_texture_path());
+    EggTexture tex(shader._name, _path_replace->store_path(fullpath));
+    tex.set_fullpath(fullpath);
+
     tex.set_wrap_u(shader._wrap_u ? EggTexture::WM_repeat : EggTexture::WM_clamp);
     tex.set_wrap_v(shader._wrap_v ? EggTexture::WM_repeat : EggTexture::WM_clamp);