Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 028099219b |
@@ -26,6 +26,9 @@ from .ui.model_card import speckle_model_card
|
|||||||
from .operators.publish import SPECKLE_OT_publish
|
from .operators.publish import SPECKLE_OT_publish
|
||||||
from .operators.load import SPECKLE_OT_load
|
from .operators.load import SPECKLE_OT_load
|
||||||
from .operators.model_card_settings import SPECKLE_OT_model_card_settings, SPECKLE_OT_view_in_browser, SPECKLE_OT_view_model_versions
|
from .operators.model_card_settings import SPECKLE_OT_model_card_settings, SPECKLE_OT_view_in_browser, SPECKLE_OT_view_model_versions
|
||||||
|
# Bindings
|
||||||
|
from .bindings.account_binding import AccountBinding
|
||||||
|
|
||||||
|
|
||||||
def save_model_cards(scene):
|
def save_model_cards(scene):
|
||||||
model_cards_data = [card.to_dict() for card in scene.speckle_model_cards]
|
model_cards_data = [card.to_dict() for card in scene.speckle_model_cards]
|
||||||
@@ -50,7 +53,8 @@ classes = (
|
|||||||
SPECKLE_OT_model_selection_dialog, speckle_model, SPECKLE_UL_models_list,
|
SPECKLE_OT_model_selection_dialog, speckle_model, SPECKLE_UL_models_list,
|
||||||
SPECKLE_OT_version_selection_dialog, speckle_version, SPECKLE_UL_versions_list,
|
SPECKLE_OT_version_selection_dialog, speckle_version, SPECKLE_UL_versions_list,
|
||||||
SPECKLE_OT_selection_filter_dialog,
|
SPECKLE_OT_selection_filter_dialog,
|
||||||
speckle_model_card, SPECKLE_OT_model_card_settings, SPECKLE_OT_view_in_browser, SPECKLE_OT_view_model_versions)
|
speckle_model_card, SPECKLE_OT_model_card_settings, SPECKLE_OT_view_in_browser, SPECKLE_OT_view_model_versions,
|
||||||
|
AccountBinding)
|
||||||
|
|
||||||
@bpy.app.handlers.persistent
|
@bpy.app.handlers.persistent
|
||||||
def load_handler(dummy):
|
def load_handler(dummy):
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
class AccountBinding:
|
||||||
|
def get_accounts(self): #-> Account[]:
|
||||||
|
# call sqlite to get accounts from Accounts.db, return
|
||||||
|
return
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
class SendBinding:
|
||||||
|
|
||||||
|
def send(self, model_card_id: str):
|
||||||
|
# TODO:
|
||||||
|
# 1- find model card from context(or whatever state)
|
||||||
|
# 2- find objects to send
|
||||||
|
# 3- call converter bla bla
|
||||||
|
# .....
|
||||||
|
return
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import UILayout, Context
|
from bpy.types import UILayout, Context
|
||||||
from .icons import get_icon
|
from .icons import get_icon
|
||||||
|
from bindings.account_binding import AccountBinding
|
||||||
|
|
||||||
# Main Panel
|
# Main Panel
|
||||||
class SPECKLE_PT_main_panel(bpy.types.Panel):
|
class SPECKLE_PT_main_panel(bpy.types.Panel):
|
||||||
@@ -16,10 +17,15 @@ class SPECKLE_PT_main_panel(bpy.types.Panel):
|
|||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
bl_category = 'Speckle'
|
bl_category = 'Speckle'
|
||||||
|
|
||||||
|
bindings = {"accountBinding": AccountBinding()}
|
||||||
|
|
||||||
def draw(self, context: Context) -> None:
|
def draw(self, context: Context) -> None:
|
||||||
layout : UILayout = self.layout
|
layout : UILayout = self.layout
|
||||||
layout.label(text="Speckle Connector BETA", icon_value=get_icon("speckle_logo"))
|
layout.label(text="Speckle Connector BETA", icon_value=get_icon("speckle_logo"))
|
||||||
|
|
||||||
|
# for (binding_name, binding) in self.bindings:
|
||||||
|
# context[binding_name] = binding
|
||||||
|
|
||||||
# Check to see if there are any speckle models in the file
|
# Check to see if there are any speckle models in the file
|
||||||
if not context.scene.speckle_model_cards:
|
if not context.scene.speckle_model_cards:
|
||||||
layout.label(text="Hello!")
|
layout.label(text="Hello!")
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ class SPECKLE_OT_project_selection_dialog(bpy.types.Operator):
|
|||||||
def draw(self, context: Context) -> None:
|
def draw(self, context: Context) -> None:
|
||||||
# TODO: Add UI elements here
|
# TODO: Add UI elements here
|
||||||
layout : UILayout = self.layout
|
layout : UILayout = self.layout
|
||||||
|
accounts = context.accountBinding.get_accounts()
|
||||||
# Account selection
|
# Account selection
|
||||||
# TODO: Connect to Speckle API to get accounts
|
# TODO: Connect to Speckle API to get accounts
|
||||||
layout.prop(self, "account", text="")
|
layout.prop(self, "account", text="")
|
||||||
|
|||||||
Reference in New Issue
Block a user