mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
MaxScene Family introduction
This commit is contained in:
parent
39e29ee8c5
commit
739b2db0f0
6 changed files with 56 additions and 27 deletions
26
openpype/hosts/max/plugins/create/create_maxScene.py
Normal file
26
openpype/hosts/max/plugins/create/create_maxScene.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Creator plugin for creating raw max scene."""
|
||||
from openpype.hosts.max.api import plugin
|
||||
from openpype.pipeline import CreatedInstance
|
||||
|
||||
|
||||
class CreateMaxScene(plugin.MaxCreator):
|
||||
identifier = "io.openpype.creators.max.maxScene"
|
||||
label = "Max Scene(Raw)"
|
||||
family = "maxScene"
|
||||
icon = "gear"
|
||||
|
||||
def create(self, subset_name, instance_data, pre_create_data):
|
||||
from pymxs import runtime as rt
|
||||
sel_obj = list(rt.selection)
|
||||
instance = super(CreateMaxScene, self).create(
|
||||
subset_name,
|
||||
instance_data,
|
||||
pre_create_data) # type: CreatedInstance
|
||||
container = rt.getNodeByName(instance.data.get("instance_node"))
|
||||
# TODO: Disable "Add to Containers?" Panel
|
||||
# parent the selected cameras into the container
|
||||
for obj in sel_obj:
|
||||
obj.parent = container
|
||||
# for additional work on the node:
|
||||
# instance_node = rt.getNodeByName(instance.get("instance_node"))
|
||||
|
|
@ -9,7 +9,8 @@ from openpype.hosts.max.api import lib
|
|||
class MaxSceneLoader(load.LoaderPlugin):
|
||||
"""Max Scene Loader"""
|
||||
|
||||
families = ["camera"]
|
||||
families = ["camera",
|
||||
"maxScene"]
|
||||
representations = ["max"]
|
||||
order = -8
|
||||
icon = "code-fork"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ class ExtractMaxSceneRaw(publish.Extractor,
|
|||
|
||||
order = pyblish.api.ExtractorOrder - 0.2
|
||||
label = "Extract Max Scene (Raw)"
|
||||
hosts = ["max"]
|
||||
hosts = ["max",
|
||||
"maxScene"]
|
||||
families = ["camera"]
|
||||
optional = True
|
||||
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
"camera",
|
||||
"animation",
|
||||
"model",
|
||||
"maxScene",
|
||||
"mayaAscii",
|
||||
"mayaScene",
|
||||
"setdress",
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
"camera",
|
||||
"animation",
|
||||
"model",
|
||||
"maxScene",
|
||||
"mayaAscii",
|
||||
"mayaScene",
|
||||
"setdress",
|
||||
|
|
|
|||
|
|
@ -45,13 +45,11 @@ function Start-Progress {
|
|||
|
||||
# $origpos.Y -= 1
|
||||
|
||||
while (($job.State -eq "Running") -and ($job.State -ne "NotStarted"))
|
||||
{
|
||||
while (($job.State -eq "Running") -and ($job.State -ne "NotStarted")) {
|
||||
$host.UI.RawUI.CursorPosition = $origpos
|
||||
Write-Host $scroll[$idx] -NoNewline
|
||||
$idx++
|
||||
if ($idx -ge $scroll.Length)
|
||||
{
|
||||
if ($idx -ge $scroll.Length) {
|
||||
$idx = 0
|
||||
}
|
||||
Start-Sleep -Milliseconds 100
|
||||
|
|
@ -147,7 +145,8 @@ catch {
|
|||
if (-not $disable_submodule_update) {
|
||||
Write-Color -Text ">>> ", "Making sure submodules are up-to-date ..." -Color Green, Gray
|
||||
& git submodule update --init --recursive
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Color -Text "*** ", "Not updating submodules ..." -Color Green, Gray
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +157,8 @@ if (-not (Test-Path -PathType Container -Path "$($env:POETRY_HOME)\bin")) {
|
|||
Write-Color -Text "NOT FOUND" -Color Yellow
|
||||
Write-Color -Text "*** ", "We need to install Poetry create virtual env first ..." -Color Yellow, Gray
|
||||
& "$openpype_root\tools\create_env.ps1"
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Color -Text "OK" -Color Green
|
||||
}
|
||||
|
||||
|
|
@ -173,8 +173,7 @@ $startTime = [int][double]::Parse((Get-Date -UFormat %s))
|
|||
|
||||
$out = & "$($env:POETRY_HOME)\bin\poetry" run python setup.py build 2>&1
|
||||
Set-Content -Path "$($openpype_root)\build\build.log" -Value $out
|
||||
if ($LASTEXITCODE -ne 0)
|
||||
{
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Color -Text "------------------------------------------" -Color Red
|
||||
Get-Content "$($openpype_root)\build\build.log"
|
||||
Write-Color -Text "------------------------------------------" -Color Yellow
|
||||
|
|
@ -189,8 +188,8 @@ Write-Color -Text ">>> ", "Restoring current directory" -Color Green, Gray
|
|||
Set-Location -Path $current_dir
|
||||
|
||||
$endTime = [int][double]::Parse((Get-Date -UFormat %s))
|
||||
try
|
||||
{
|
||||
try {
|
||||
New-BurntToastNotification -AppLogo "$openpype_root/openpype/resources/icons/openpype_icon.png" -Text "OpenPype build complete!", "All done in $( $endTime - $startTime ) secs. You will find OpenPype and build log in build directory."
|
||||
} catch {}
|
||||
}
|
||||
catch {}
|
||||
Write-Color -Text "*** ", "All done in ", $($endTime - $startTime), " secs. You will find OpenPype and build log in ", "'.\build'", " directory." -Color Green, Gray, White, Gray, White, Gray
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue