Compare commits

...

1 Commits

Author SHA1 Message Date
Oguzhan Koral 028099219b TODOs 2024-10-01 20:07:42 +03:00
6 changed files with 29 additions and 1 deletions
+5 -1
View File
@@ -26,6 +26,9 @@ from .ui.model_card import speckle_model_card
from .operators.publish import SPECKLE_OT_publish
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
# Bindings
from .bindings.account_binding import AccountBinding
def save_model_cards(scene):
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_version_selection_dialog, speckle_version, SPECKLE_UL_versions_list,
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
def load_handler(dummy):
View File
+6
View File
@@ -0,0 +1,6 @@
class AccountBinding:
def get_accounts(self): #-> Account[]:
# call sqlite to get accounts from Accounts.db, return
return
+11
View File
@@ -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
+6
View File
@@ -1,6 +1,7 @@
import bpy
from bpy.types import UILayout, Context
from .icons import get_icon
from bindings.account_binding import AccountBinding
# Main 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_category = 'Speckle'
bindings = {"accountBinding": AccountBinding()}
def draw(self, context: Context) -> None:
layout : UILayout = self.layout
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
if not context.scene.speckle_model_cards:
layout.label(text="Hello!")
@@ -86,6 +86,7 @@ class SPECKLE_OT_project_selection_dialog(bpy.types.Operator):
def draw(self, context: Context) -> None:
# TODO: Add UI elements here
layout : UILayout = self.layout
accounts = context.accountBinding.get_accounts()
# Account selection
# TODO: Connect to Speckle API to get accounts
layout.prop(self, "account", text="")