replace 'fname' with 'filepath_from_context' (#5000)

This commit is contained in:
Jakub Trllo 2023-05-22 14:11:21 +02:00 committed by Jakub Trllo
parent a627615a61
commit c9edd211af
6 changed files with 8 additions and 7 deletions

View file

@ -18,7 +18,7 @@ class ModelAbcLoader(load.LoaderPlugin):
def load(self, context, name=None, namespace=None, data=None):
from pymxs import runtime as rt
file_path = os.path.normpath(self.fname)
file_path = os.path.normpath(self.filepath_from_context(context))
abc_before = {
c

View file

@ -17,7 +17,7 @@ class FbxModelLoader(load.LoaderPlugin):
def load(self, context, name=None, namespace=None, data=None):
from pymxs import runtime as rt
filepath = os.path.normpath(self.fname)
filepath = os.path.normpath(self.filepath_from_context(context))
rt.FBXImporterSetParam("Animation", False)
rt.FBXImporterSetParam("Cameras", False)
rt.FBXImporterSetParam("Preserveinstances", True)

View file

@ -18,7 +18,7 @@ class ObjLoader(load.LoaderPlugin):
def load(self, context, name=None, namespace=None, data=None):
from pymxs import runtime as rt
filepath = os.path.normpath(self.fname)
filepath = os.path.normpath(self.filepath_from_context(context))
self.log.debug("Executing command to import..")
rt.Execute(f'importFile @"{filepath}" #noPrompt using:ObjImp')

View file

@ -20,7 +20,7 @@ class ModelUSDLoader(load.LoaderPlugin):
from pymxs import runtime as rt
# asset_filepath
filepath = os.path.normpath(self.fname)
filepath = os.path.normpath(self.filepath_from_context(context))
import_options = rt.USDImporter.CreateOptions()
base_filename = os.path.basename(filepath)
filename, ext = os.path.splitext(base_filename)

View file

@ -18,7 +18,7 @@ class PointCloudLoader(load.LoaderPlugin):
"""load point cloud by tyCache"""
from pymxs import runtime as rt
filepath = os.path.normpath(self.fname)
filepath = os.path.normpath(self.filepath_from_context(context))
obj = rt.tyCache()
obj.filename = filepath