Hello!
Banging my head against the computer…
I am trying to get the pre script for loading my Geometry working.
I have been looking for any typos but can’t find any.
I set my maya.env path with the following:
MGEAR_SHIFTER_CUSTOMSTEP_PATH = /Users/todd/Rod Dropbox/thor can/maya/projects/grays/custom_steps
The path to my scripts and Geo are:
/Users/todd/Rod Dropbox/thor can/maya/projects/grays/custom_steps/scripts/pre/import_geo.py
/Users/todd/Rod Dropbox/thor can/maya/projects/grays/custom_steps/assets/geo.ma
I add the import_geo.py file to the guide settings and get the following faliure on build:
GEAR version : 4.0.7
= SHIFTER RIG SYSTEM ==============================================
= PRE CUSTOM STEPS ==============================================
// EXEC: Executing custom step: scripts/pre/import_geo.py //
// Error: An exception of type RuntimeError occurred. //
// Error: Traceback (most recent call last):
File “/Users/todd/Library/Preferences/Autodesk/maya/modules/scripts/mgear/shifter/guide.py”, line 1345, in runStep
cs.run(customStepDic)
File “/Users/todd/CalRod Dropbox/todd calvert/maya/projects/grays/custom_steps/scripts/pre/import_geo.py”, line 25, in run
self.import_geometry()
File “/Users/todd/CalRod Dropbox/todd calvert/maya/projects/grays/custom_steps/scripts/pre/import_geo.py”, line 37, in import_geometry
pm.importFile(os.path.join(path, “assets”, “geo.ma”))
File “/Applications/Autodesk/maya2020/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages/pymel/core/system.py”, line 2058, in importFile
res = cmds.file(filepath, **kwargs)
File “/Applications/Autodesk/maya2020/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages/pymel/internal/pmcmds.py”, line 130, in file_wrapped
res = new_cmd(*new_args, **new_kwargs)
RuntimeError: File not found.
//
The code for the import_geo.py is unchanged to from the Github file.
‘’’
import os
import mgear.shifter.custom_step as cstp
import pymel.core as pm
class CustomShifterStep(cstp.customShifterMainStep):
def init(self):
self.name = “import_geo”
def run(self, stepDict):
"""Run method.
i.e: stepDict["mgearRun"].global_ctl gets the global_ctl from
shifter rig on post step
i.e: stepDict["otherCustomStepName"].ctlMesh gets the ctlMesh
from a previous custom step called "otherCustomStepName"
Arguments:
stepDict (dict): Dictionary containing the objects from
the previous steps
Returns:
None: None
"""
self.import_geometry()
try:
pm.select("guide")
except:
pass
def import_geometry(self):
path = "\\".join(os.path.abspath(
os.path.dirname(__file__)).split("\\")[:-2])
pm.importFile(os.path.join(path, "assets", "geo.ma"))
‘’’