def bootstrap_tank(): try: import tank except Exception, e: mxs.messageBox("Shotgun: Could not import sgtk! Disabling for now: %s" % e) return
def bootstrap_tank(): try: import tank except Exception, e: mxs.messageBox( "Shotgun: Could not import sgtk! Disabling for now: %s" % e) return
def convert_object(): """ pydoc """ current_selection = mxs.selection if len(current_selection) > 0: for m in current_selection: mxs.convertTo(m, mxs.editable_Poly) randomR = random.randint(10, 200) randomB = random.randint(10, 200) randomG = random.randint(10, 200) m.wireColor = mxs.color(randomR, randomG, randomB) else: mxs.messageBox("Nothing selected") mxs.completeRedraw()
def bootstrap_tank(): try: import tank except Exception as e: mxs.messageBox( "Shotgun: Could not import sgtk! Disabling for now: %s" % e) return if not "TANK_ENGINE" in os.environ: mxs.messageBox( "Shotgun: Missing required environment variable TANK_ENGINE.") return engine_name = os.environ.get("TANK_ENGINE") try: context = tank.context.deserialize(os.environ.get("TANK_CONTEXT")) except Exception as e: mxs.messageBox( "Shotgun: Could not create context! Shotgun Pipeline Toolkit will be disabled. Details: %s" % e) return try: engine = tank.platform.start_engine(engine_name, context.tank, context) except Exception as e: mxs.messageBox("Shotgun: Could not start engine: %s" % e) return # clean up temp env vars for var in ["TANK_ENGINE", "TANK_CONTEXT", "TANK_FILE_TO_OPEN"]: if var in os.environ: del os.environ[var]
def load_item_from_path_3dsmax(self, path): from Py3dsMax import mxs # there is a file open if mxs.getSaveRequired(): # there are unsaved changes in the scene # TODO: handle this for the user! # the currently opened file has not been saved mxs.messageBox("Your current scene has unsaved changes. Please save it before proceeding.") return else: # no need to save any change. load new file. mxs.loadMaxFile(path)
# Py3dsMax libs from Py3dsMax import mxs def bootstrap_tank(): try: import tank except Exception, e: mxs.messageBox( "Shotgun: Could not import sgtk! Disabling for now: %s" % e) return if not "TANK_ENGINE" in os.environ: mxs.messageBox( "Shotgun: Missing required environment variable TANK_ENGINE.") return engine_name = os.environ.get("TANK_ENGINE") try: context = tank.context.deserialize(os.environ.get("TANK_CONTEXT")) except Exception, e: mxs.messageBox( "Shotgun: Could not create context! Shotgun Pipeline Toolkit will be disabled. Details: %s" % e) return try: engine = tank.platform.start_engine(engine_name, context.tank, context) except Exception, e: mxs.messageBox("Shotgun: Could not start engine: %s" % e)
import os # Py3dsMax libs from Py3dsMax import mxs def bootstrap_tank(): try: import tank except Exception, e: mxs.messageBox("Shotgun: Could not import sgtk! Disabling for now: %s" % e) return if not "TANK_ENGINE" in os.environ: mxs.messageBox("Shotgun: Missing required environment variable TANK_ENGINE.") return engine_name = os.environ.get("TANK_ENGINE") try: context = tank.context.deserialize(os.environ.get("TANK_CONTEXT")) except Exception, e: mxs.messageBox("Shotgun: Could not create context! Shotgun Pipeline Toolkit will be disabled. Details: %s" % e) return try: engine = tank.platform.start_engine(engine_name, context.tank, context) except Exception, e: mxs.messageBox("Shotgun: Could not start engine: %s" % e) return