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):
|
||||
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 = (
|
||||
SessionStartOperator,
|
||||
@ -369,6 +388,7 @@ classes = (
|
||||
SessionPropertyRightOperator,
|
||||
SessionDumpDatabase,
|
||||
SessionSaveConfig,
|
||||
SessionApply,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
5
ui.py
5
ui.py
@ -1,5 +1,6 @@
|
||||
import bpy
|
||||
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',
|
||||
@ -236,6 +237,10 @@ class SESSION_PT_outliner(bpy.types.Panel):
|
||||
detail_item_box.label(text="",icon=item.icon)
|
||||
detail_item_box.label(text="{} ".format(name))
|
||||
detail_item_box.label(text="{} ".format(item.owner))
|
||||
|
||||
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]))
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user