feat: apply operator ground work
This commit is contained in:
Submodule libs/replication updated: 5731858981...dcf67a40e3
20
operators.py
20
operators.py
@ -359,6 +359,25 @@ class SessionSaveConfig(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
context.window_manager.session.save()
|
context.window_manager.session.save()
|
||||||
|
|
||||||
|
class SessionApply(bpy.types.Operator):
|
||||||
|
bl_idname = "session.apply"
|
||||||
|
bl_label = "apply the target item into the blender data"
|
||||||
|
bl_description = "Apply target object into blender data"
|
||||||
|
bl_options = {"REGISTER"}
|
||||||
|
|
||||||
|
target = bpy.props.StringProperty()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
global client
|
||||||
|
|
||||||
|
client.apply(uuid=self.target)
|
||||||
|
|
||||||
|
return {"FINISHED"}
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
SessionStartOperator,
|
SessionStartOperator,
|
||||||
@ -369,6 +388,7 @@ classes = (
|
|||||||
SessionPropertyRightOperator,
|
SessionPropertyRightOperator,
|
||||||
SessionDumpDatabase,
|
SessionDumpDatabase,
|
||||||
SessionSaveConfig,
|
SessionSaveConfig,
|
||||||
|
SessionApply,
|
||||||
)
|
)
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
7
ui.py
7
ui.py
@ -1,5 +1,6 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from . import operators
|
from . import operators
|
||||||
|
from .libs.replication.constants import *
|
||||||
|
|
||||||
|
|
||||||
ICONS = {'Image': 'IMAGE_DATA', 'Curve':'CURVE_DATA', 'Client':'SOLO_ON','Collection': 'FILE_FOLDER', 'Mesh': 'MESH_DATA', 'Object': 'OBJECT_DATA', 'Material': 'MATERIAL_DATA',
|
ICONS = {'Image': 'IMAGE_DATA', 'Curve':'CURVE_DATA', 'Client':'SOLO_ON','Collection': 'FILE_FOLDER', 'Mesh': 'MESH_DATA', 'Object': 'OBJECT_DATA', 'Material': 'MATERIAL_DATA',
|
||||||
@ -236,7 +237,11 @@ class SESSION_PT_outliner(bpy.types.Panel):
|
|||||||
detail_item_box.label(text="",icon=item.icon)
|
detail_item_box.label(text="",icon=item.icon)
|
||||||
detail_item_box.label(text="{} ".format(name))
|
detail_item_box.label(text="{} ".format(name))
|
||||||
detail_item_box.label(text="{} ".format(item.owner))
|
detail_item_box.label(text="{} ".format(item.owner))
|
||||||
detail_item_box.label(text="{} ".format(PROP_STATES[item.state]))
|
|
||||||
|
if item.state == FETCHED:
|
||||||
|
detail_item_box.operator("session.apply", text=PROP_STATES[item.state]).target = item.uuid
|
||||||
|
else:
|
||||||
|
detail_item_box.label(text="{} ".format(PROP_STATES[item.state]))
|
||||||
|
|
||||||
|
|
||||||
# right_icon = "DECORATE_UNLOCKED"
|
# right_icon = "DECORATE_UNLOCKED"
|
||||||
|
Reference in New Issue
Block a user