mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
replace 'fname' with 'filepath_from_context' (#5000)
This commit is contained in:
parent
a627615a61
commit
c9edd211af
6 changed files with 8 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ class SubstanceLoadProjectMesh(load.LoaderPlugin):
|
|||
|
||||
if not substance_painter.project.is_open():
|
||||
# Allow to 'initialize' a new project
|
||||
result = prompt_new_file_with_mesh(mesh_filepath=self.fname)
|
||||
path = self.filepath_from_context(context)
|
||||
result = prompt_new_file_with_mesh(mesh_filepath=path)
|
||||
if not result:
|
||||
self.log.info("User cancelled new project prompt.")
|
||||
return
|
||||
|
|
@ -65,7 +66,7 @@ class SubstanceLoadProjectMesh(load.LoaderPlugin):
|
|||
else:
|
||||
raise LoadError("Reload of mesh failed")
|
||||
|
||||
path = self.fname
|
||||
path = self.filepath_from_context(context)
|
||||
substance_painter.project.reload_mesh(path,
|
||||
settings,
|
||||
on_mesh_reload)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue