forked from ynput/OpenPype
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Optimization of Integrate Blender Asset using pooling (#67)
* Feature: Optimization of Integrate Blender Asset using pooling and subprocesses * fix main command without path management
- Loading branch information
Showing
3 changed files
with
83 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
openpype/hosts/blender/plugins/publish/pause_sync_server.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import pyblish | ||
|
||
from openpype.modules.base import ModulesManager | ||
from openpype.plugins.publish.integrate import IntegrateAsset | ||
|
||
|
||
class PauseSyncServer(pyblish.api.ContextPlugin): | ||
label = "Pause Sync Server" | ||
hosts = ["blender"] | ||
order = IntegrateAsset.order - 0.01 | ||
|
||
def process(self, context): | ||
manager = ModulesManager() | ||
sync_server_module = manager.modules_by_name["sync_server"] | ||
sync_server_module.pause_server() | ||
# TODO should pause only project but doesn't work because | ||
# _paused_projects is cached but sync server is not a singleton |
17 changes: 17 additions & 0 deletions
17
openpype/hosts/blender/plugins/publish/unpause_sync_server.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import pyblish | ||
|
||
from openpype.modules.base import ModulesManager | ||
from openpype.modules.timers_manager.plugins.publish.start_timer import ( | ||
StartTimer, | ||
) | ||
|
||
|
||
class UnpauseSyncServer(pyblish.api.ContextPlugin): | ||
label = "Unpause Sync Server" | ||
hosts = ["blender"] | ||
order = StartTimer.order | ||
|
||
def process(self, context): | ||
manager = ModulesManager() | ||
sync_server_module = manager.modules_by_name["sync_server"] | ||
sync_server_module.unpause_server() |