Compare commits

...

917 Commits

Author SHA1 Message Date
Oğuzhan Koral 760d8a033d Treat grouped mesh as sketchup entity (#449)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2026-01-30 10:34:27 +03:00
Oğuzhan Koral 96cd122645 Fix: add definition attributes to block instances (#448)
* wip

* get definition and instance props under properties

* Reordering docs
2026-01-16 15:38:33 +03:00
Oğuzhan Koral 533768eb14 strip out @ from detached props (#447) 2026-01-16 14:22:50 +03:00
Oğuzhan Koral c88d3c632d skip if elevation or units null (#446)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2026-01-16 10:27:38 +03:00
Oğuzhan Koral 72f5185992 feat: do not try to hightlight on no selection (#445) 2026-01-13 10:40:31 +03:00
Oğuzhan Koral b8db07a66b Feat: add account (#443)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
* fix(macos): appdata path

* feat: add account via sqlite

* revert: material manager

* revert: dui url

* doc
2025-10-26 09:08:54 +03:00
Oğuzhan Koral 366b961039 Do not init diff materials (#440)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-10-14 14:02:59 +03:00
Oğuzhan Koral e244a7e2e5 Convert argb to int always to be safe (#439)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-10-14 13:28:52 +03:00
Mucahit Bilal GOKER 9b55764b38 replace logos (#437) 2025-10-03 12:28:26 +03:00
Oğuzhan Koral 4b8012f94b fix(macos): appdata path (#438) 2025-09-17 20:35:49 +03:00
Oğuzhan Koral 9871000d84 no more netlify url (#436)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-07-23 17:47:27 +01:00
kekesidavid 17a056b3b9 fix(sketchup) fix for orphan edges (#435)
* fix for orphan edges

* fix
2025-07-10 13:27:34 +03:00
Oğuzhan Koral a8c5bd573f Try adding object ids to render material proxies (#434)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-06-26 22:12:23 +03:00
Oğuzhan Koral 1d2fe047bf Fix: initializing sketchup connector on large models takes a lot (#433)
* Attach observers to only orphan edges

* Do not try to read entities on load
2025-06-26 19:36:35 +03:00
Jedd Morgan 3465f86605 chore(ci): Replace GitVersion (#431) 2025-06-26 11:58:30 +03:00
Oğuzhan Koral 540e727b73 Iterate sections planes over level proxies (#432) 2025-06-23 18:59:24 +03:00
Oğuzhan Koral 8c576f820c Default to unnamed folder name if name is empty string (#429) 2025-05-22 17:28:38 +03:00
Jedd Morgan df3b673064 refactor(ci): Update workflow to use new consolidated deployment workflow (#428)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
* Updated workflow

* update workflow

* target main
2025-04-25 10:43:27 +01:00
Oğuzhan Koral 69bde5539c Add serverUrl and workspaceSlug to model cards (#427)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-04-21 15:06:19 +03:00
Oğuzhan Koral aa12b7b11b remove unnessary logging (#426) 2025-04-21 14:11:45 +03:00
Oğuzhan Koral e0b3b3cca2 Convert revit data object natively (#425) 2025-04-21 14:08:20 +03:00
Jedd Morgan ea9a5741d7 Update config.yml (#424) 2025-04-21 10:30:19 +03:00
Oğuzhan Koral 1fe1c8d5a8 Fix the source of the issue (#423)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-03-28 16:47:56 +03:00
Oğuzhan Koral ac58560a69 Verbose about menu commands and guard about name (#422)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-03-24 15:32:39 +03:00
Oğuzhan Koral d0b234bf3d delete ruby.yml temp (#421)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-03-19 13:32:09 +03:00
oguzhankoral 981fe05c15 deploy over main 2025-03-19 11:50:17 +03:00
Oğuzhan Koral 918550465b No more beta (#418) 2025-03-19 10:20:46 +03:00
Oğuzhan Koral 963d4f1738 Add remove account and remove models (#417) 2025-03-19 10:16:34 +03:00
oguzhankoral d809732280 Merge branch 'dui3/alpha'
# Conflicts:
#	.circleci/config.yml
2025-03-17 23:16:02 +03:00
oguzhankoral c4e38a11b7 run on ubuntu-22.04 2025-03-17 20:03:42 +03:00
oguzhankoral 7abe215bc2 sorry circleci, have you back for now 2025-03-17 20:01:04 +03:00
oguzhankoral 0f269430bc no more circleci 2025-03-17 19:29:39 +03:00
Oğuzhan Koral b8a298c54b Fix: various papercuts (#409)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
* Do not report converted grouped meshes

* remember last selected account on db
2025-03-10 18:36:58 +03:00
Oğuzhan Koral e1d33cd250 fix the highlight freeze (#408) 2025-03-10 16:18:07 +03:00
Oğuzhan Koral 4563dec9bc Debounce progress update (#407) 2025-03-07 21:07:44 +03:00
Oğuzhan Koral de284083fd add defintiion and layer name to instance proxy (#406)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-03-07 12:19:11 +03:00
Oğuzhan Koral 85ee66ca4d Fix(instances): instance name prop is missing (#405)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
* add name to instances

* set name only if it is not empty
2025-03-07 12:04:16 +03:00
Jedd Morgan 5365dc858e Jedd/cxpla 169 update connector deployment ci to error on publishing zero (#404)
* Update deploy.yml

* Update build.yml
2025-03-05 11:47:56 +03:00
Oğuzhan Koral 69f9544638 get accounts always from sqlite - not from cached state (#403)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-02-27 14:57:28 +03:00
Oğuzhan Koral bf5409cf90 Feat(dui3): add properties (#402)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
* rename sketchup_attributes with properties for send

* receive properties

* handle send receive properties
2025-02-18 22:32:05 +03:00
Oğuzhan Koral bd4f668526 Make selection is default (#401)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2025-01-16 19:34:16 +03:00
Oğuzhan Koral d21df0c6fd Update build.yml
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2024-12-20 17:33:55 +03:00
Oğuzhan Koral d808fdaa09 Update build.yml 2024-12-20 17:31:44 +03:00
Oğuzhan Koral b32d23b9d6 Do not check speckle_type from level anymore (#400)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2024-12-19 20:44:13 +03:00
Oğuzhan Koral d1b8ba95df Fix(arc): CNX-712 civil2skp alignments missing pieces (#399)
* Normalize plane axis always

* measure based fix

* backward compatible arcs without measures
2024-12-13 00:26:44 +03:00
Oğuzhan Koral 5e6825bbdb Feat(dui3): sketchup send batches sequentially (#397)
* feat: send batches in sequence and create commit later

* Remove load tests
2024-12-12 12:26:11 +03:00
Oğuzhan Koral 3e5ba136be Align arcs with new object model (#396) 2024-11-11 14:33:23 +00:00
oguzhankoral 294b49a11c Add debug notes 2024-11-11 12:01:09 +00:00
Oğuzhan Koral 9e0cca447f Rename the menu title as Speckle Beta (#393)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2024-10-26 23:00:11 +03:00
Oğuzhan Koral bc3f23d8dd Add units to root object on send (#392)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2024-09-23 19:35:01 +03:00
oguzhankoral 4fcf11eaa8 Fix url 2024-09-19 14:27:13 +03:00
Oğuzhan Koral 1f45902837 Add workspace id to model cards (#391)
Co-authored-by: Oguzhan Koral <oguzhankoral@192.168.1.104>
2024-09-16 16:49:22 +03:00
Oğuzhan Koral bc55543e23 Feat(dui3): add new properties to receiver model card (#390)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
* Add new properties to receiver model card

* Update state correctly from read data at doc init
2024-09-11 15:11:54 +03:00
Oğuzhan Koral c1b8ec7036 Create DUI3Config.db file and objects table if not exists (#389)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2024-09-06 02:12:12 +03:00
Alan Rynne abe9de1b4a fix: Update gitversion to v6 to align with csharp connectors (#388)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2024-09-03 12:21:42 +02:00
Alan Rynne 09cc83eb14 fix: Prefix tag trigger with v as GitVersion expects (#387)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled
2024-09-03 12:01:15 +02:00
Alan Rynne 8f7b3fce0c Added config for dui3/alpha branch. All versions from this branch will be suffixed with beta (#386) 2024-09-03 11:36:07 +02:00
Oğuzhan Koral f121f1adfe Feat(dui3): performance hunting v1 (#385)
* Get rid of unneccessary from_sketchup check everytime

* Correct the hard edge types
2024-09-02 01:24:52 +03:00
Oğuzhan Koral 522ace443a Fix(dui3): CNX-392 sketchup update configs properly (#384)
* Align old update config logic with new DUI3 needs

* Fix the key casing to snake for SketchUp
2024-08-30 15:51:17 +03:00
Oğuzhan Koral 8f97f59a9a Get is dev mode info from config binding and patch with packager (#383) 2024-08-29 19:18:16 +03:00
Oğuzhan Koral 8e9d98cd55 Check nullability (#382) 2024-08-29 15:51:11 +03:00
Oğuzhan Koral 746230caa0 Rename window title too (#381) 2024-08-29 14:30:18 +03:00
Oğuzhan Koral 03e80c6361 Rename the button names (#380) 2024-08-29 14:26:56 +03:00
Oğuzhan Koral bc547c13db Disable retrieving settings from add_send_model_card (#379) 2024-08-28 17:19:36 +03:00
Oğuzhan Koral 173df6128e Namepace alignment from arcgis commits (#378) 2024-08-26 16:30:48 +03:00
Oğuzhan Koral 666d882ec6 Feat(layers): CNX-352 rvt2skp levels have separate tag (#377)
* Place levels and main instance to related model layers

* Cleanup and renaming

* Do not override layers in model instance

* Extract project-model layer and folder creation

* Set layer for section planes
2024-08-26 11:08:24 +03:00
Alan Rynne 6ea13c4edc fix: Sketchup deploy was trying to pull branch that no longer exist (#376) 2024-08-22 15:11:43 +02:00
oguzhankoral 39bdff1c02 Assign materials to back too by default 2024-08-22 15:34:03 +03:00
Alan Rynne 45fc851722 feat: Adds "public release" input to deploy step if build is tagged (#375) 2024-08-22 13:07:27 +02:00
Oğuzhan Koral ede81f3a7d Feat(dui3): CNX-203 skp create tag folders for project model and document names (#374)
* WIP

* Place objects to correct layers

* Fix the rhino layers

* Place rhino layers to model folder correctly

* Clean model folder first

* Handle revit layers nicely

* Clean the all folders under the model
2024-08-22 13:51:31 +03:00
Oğuzhan Koral bae9f30445 Handle back materials (#373) 2024-08-19 13:12:31 +03:00
Oğuzhan Koral 527cefa3ef Introduce converter error for warnings (#372) 2024-08-19 12:32:28 +03:00
Oğuzhan Koral 830aee116e Re-Fix the specific face problem (#371) 2024-08-16 15:18:19 +03:00
Oğuzhan Koral 243fbea769 Include near faces (#370) 2024-08-16 00:38:24 +03:00
Oğuzhan Koral 9c885258d9 Disable ToNativeV1 (#369) 2024-08-16 00:16:20 +03:00
Oğuzhan Koral 0ad4e15f0a Disable receive definition caching (#368) 2024-08-15 15:32:01 +03:00
Oğuzhan Koral a2ba6823a3 Trigger host app error correctly (#367) 2024-08-14 23:01:39 +03:00
Oğuzhan Koral 3713abd860 Fix(dui3): CNX-291 do not even try to delete "Layer0" (#366)
* Do not try to delete Untagged even if it is changed

* Fix removing active layer with correct condition
2024-08-14 21:00:00 +03:00
Alan Rynne 5ae78fb192 CXPLA-26 Update CI jobs to pass correct version to deploy step. (#365)
* Fix: Add info_version and pass it to deploy step

* fix: Rename build outputs to have clear meaning

* fix: Remove `deploy/` branch exception

* fix: Correct build job outputs + test deploy
2024-08-14 13:58:18 +02:00
Oğuzhan Koral 0b694833fb Implement card settings logic (#364) 2024-08-13 20:09:21 +03:00
Alan Rynne dfd82e6d40 feat: Add GitVersion to sketchup CI run (#363)
* feat: Add GitVersion to sketchup CI run

* fix: Temp trigger from my branch

* feat: Separate build and deploy jobs

* fix: Missing value field on build workflow

* fix: Job names

* fix: Remove on push for build job

* fix: Pull request trigger

* fix: Only trigger on dui3/alpha branch
2024-08-13 19:43:49 +03:00
Oğuzhan Koral 1694786177 Switch layer to Untagged if matches (#362) 2024-08-12 14:54:26 +03:00
Oğuzhan Koral ec72cc1454 Fix(dui3): stringfy application id and proxy object ids (#361)
* Use string for every piece of persistent_id

* Also convert collected persistent_ids to string too

* Correct the url with non-branch version
2024-08-12 11:35:28 +03:00
Oğuzhan Koral 37ba4d9a80 Fix layer type (#360) 2024-08-08 20:13:45 +03:00
Oğuzhan Koral 526e497037 Remove total childen count from everywhere (#359) 2024-08-08 15:42:37 +03:00
Oğuzhan Koral a81a723ba8 Skip definition deletion and do not remove active layer (#358) 2024-08-08 00:26:17 +03:00
Oğuzhan Koral 5976898f07 Feat(dui3): CNX-222 colors in sketchup (#357)
* Unpack color proxies

* Receive layer colors

* Fix applicationId issue on layers

* Consider proxies are null
2024-08-07 23:23:14 +03:00
Oğuzhan Koral 09fec26841 Fix(dui3): CNX-208 skp missing and borked geometry (#356)
* Do not try to assign material if root_render_material_proxies is nil

* Do not try to get color from layer, will need CNX-222

* Fix autocad polycurves and better reporting

* Fix flipped arcs
2024-08-07 18:11:31 +03:00
Oğuzhan Koral 165eb238b5 Face instances to Bilal (#355) 2024-08-07 15:24:48 +03:00
Oğuzhan Koral de305a3508 Force string type check fixes render material issue (#354) 2024-08-07 14:57:47 +03:00
Oğuzhan Koral d124478a92 Unify function name with .net (#353) 2024-08-05 17:56:02 +03:00
Oğuzhan Koral d9acc5b39d Reset dialog location to mid for focused window (#352) 2024-08-04 22:07:01 +03:00
Oğuzhan Koral 5b91a04e1e Feat(dui3): v3 installer build test (#351)
* Create v3-fake.yml

* Run on PR

* Disable patching iss

* Fix typoo

* Rename artifact to sketchup

* Add deployment steps

* Do not name artifact name

* Define which branch to build installer

* Align CI installers with new branch and files

* Get patch installer back

* Remove circleci again

* Rename file and enable tags

* Test enabling PR runs

* Test nested folders

* Test single path dll

* add all things

* try zipping manually first

* don't need sub dir

* rename zip

* Use version from env variables

* Test git version

* More test

* Test

* Revert

* install gitversion

* test

* Use hardcoded version

* Remove pull request trigger

---------

Co-authored-by: Adam Hathcock <adam@speckle.systems>
2024-08-02 15:08:20 +03:00
Oğuzhan Koral d145ce52f7 Sketchup DUI2-DUI3 side by side (#350)
* New sqlite3 libraries for new namespace

* Rename top level module to SpeckleConnector3

* Register extension as v3

* Add new sqlite3 libraries for mac

* Update bundle files for hybrid build mac/intel

* Rename speckle_connector_loader for v3

* Rename file and folder

* Rename loader
2024-07-31 19:26:38 +03:00
Oğuzhan Koral ec598bf4a8 Global toast from top level exception handler (#349)
* Set global notification on handling error

* Add notes
2024-07-27 15:41:06 +03:00
Oğuzhan Koral 568e679e3f Feat(dui3): render materials via proxy (#348)
* Send render materials

* Receive materials from proxy

* Do not set materials to instance and face
2024-07-25 23:52:01 +03:00
Oğuzhan Koral 85cc49f4d9 Temp hack for deep clean (#347) 2024-07-22 20:02:27 +03:00
oguzhankoral 65b07d44ab Tooling around skippy for 2024 debug 2024-07-22 14:40:53 +03:00
oguzhankoral f87bc98169 Doc for sorted_set 2024-07-22 14:03:46 +03:00
oguzhankoral 04270a8abc Upgrade debugger for Ruby 3.2 and SU 2024 2024-07-22 13:14:03 +03:00
Oğuzhan Koral 65fa47c9ac Upgrade xcode to 13.4.1 (#346) 2024-07-20 13:26:15 +03:00
Oğuzhan Koral 9367ea7e17 Layers and colors (#345) 2024-07-18 20:12:41 +02:00
Oğuzhan Koral b7ac9d1fee Receive skp groups as components (#344) 2024-07-18 15:51:29 +02:00
Oğuzhan Koral f20b26045c Align collections and proxies (#342) 2024-07-18 01:10:03 +02:00
Oğuzhan Koral 4bcbc5131b Fix missing objects in definition proxy (#341) 2024-07-16 16:21:47 +02:00
Oğuzhan Koral eeea2d7c8d Grouped meshes by layer and material (#339)
* POC grouped meshes for perf

* Better group mesh

* Add doc fix minor

* Consider back material for meshes

* Remove unused grouped meshes functions

* Remove unnecessary line
2024-07-16 12:57:19 +02:00
Oğuzhan Koral 68e9468294 Fix progress update and some performance (#338)
* Fix send conversion status

* Do not add non-orphan edges to flat atomic objects (~3x performance gain)
2024-07-10 18:55:18 +03:00
Oğuzhan Koral 694da73b77 Fix(blocks): update max depth of children (#337)
* Temp fix

* Update max depth of children
2024-07-09 13:59:16 +03:00
Oğuzhan Koral 15657bf0ec Feat (dui3): New blocks (#336)
* Add proxy objects

* Rename materials and definitions

* Add DefinitionManager

* Fix minor

* Tweak in converter

* Fix units

* Converter v2

* Split converter and converter_v2

* Sort arguments for converters

* Change inner terminology to FE2 for native converter v2

* Simplify arguments

* Remove one click send

* Convert definition proxies in advance then instance proxies

* Yey

* Accept uppercase Units too
2024-06-27 23:09:46 +03:00
oguzhankoral 78c6898ff0 Fix baked object ids 2024-06-05 21:47:09 +03:00
oguzhankoral 836e97a57c Flat stack trace from array to string 2024-06-05 15:11:33 +03:00
oguzhankoral 7f708108f2 Pass error message into hash to serialize 2024-06-05 15:02:53 +03:00
oguzhankoral 2d3e282150 Remove receive result -store only baked object ids 2024-06-05 14:44:01 +03:00
oguzhankoral 75b933ef0a Add conversion_result class and align for send receive 2024-06-05 14:33:16 +03:00
oguzhankoral c19799f081 Send conversion results 2024-06-03 10:37:03 +03:00
oguzhankoral 848ed922b5 Merge coplanar faces from after_get_objects 2024-05-22 11:13:37 +03:00
oguzhankoral 16e96b69a4 Set active path always to model before send 2024-05-13 18:24:36 +03:00
oguzhankoral fbdd7ee7b6 Include parents too onChangeEntity 2024-05-13 18:13:37 +03:00
oguzhankoral d3df5fceec Handle entity paths elegantly 2024-05-13 14:15:43 +03:00
oguzhankoral 948925d156 Ignore cache for grouped meshes since it breaks the object structure 2024-05-13 12:35:26 +03:00
oguzhankoral 7ab6b1b167 Do not group meshes with object referenced meshes 2024-05-13 12:23:25 +03:00
oguzhankoral ca3a109bc8 Fix non-selected update infinity json error 2024-05-13 11:11:22 +03:00
oguzhankoral ebe9551e72 Add 2024 support for DUI3 Mac 2024-05-10 10:46:31 +03:00
oguzhankoral d2836189c3 Add 2024 support for DUI3 2024-05-08 19:17:06 +03:00
oguzhankoral 3703963ec8 Merge branch 'oguzhan/worker-thread-poc' into oguzhan/dui3 2024-05-08 14:35:11 +03:00
oguzhankoral 02ca8e3a59 Do instance message send via worker 2024-05-08 02:34:32 +03:00
oguzhankoral 7c73658fa5 Remove TT dependency 2024-05-08 02:20:40 +03:00
oguzhankoral e03b448618 Enable progress bar while converting from selected entities 2024-05-08 01:33:19 +03:00
oguzhankoral c8d635752b Implement instant_message_sender over worker 2024-05-08 00:59:09 +03:00
oguzhankoral df9a5600d9 Fallback to ModelCollection always if collectionType not set 2024-05-07 23:35:17 +03:00
oguzhankoral dd730ea517 Fix typo 2024-05-07 23:18:46 +03:00
oguzhankoral 5bbfe1be59 Disable old UI button 2024-05-07 21:50:23 +03:00
oguzhankoral dd04bd8792 Rename DUI3 with New UI 2024-05-07 14:48:04 +03:00
oguzhankoral 20bc1f41f0 Fix typo on clearing cache on document switch 2024-05-07 14:25:24 +03:00
oguzhankoral 9e838734c0 Resize speckle icons
Co-authored-by: name <mucahitbgoker@gmail.com>
2024-05-07 14:18:01 +03:00
oguzhankoral 17aeca5e70 Clear cache on document switch 2024-05-07 13:46:02 +03:00
Mucahit Bilal GOKER 98852d8c22 Updated connector icons (#329) 2024-05-07 13:38:02 +03:00
oguzhankoral 674d9cd37d Track also session based ids
This was needed because of onElementRemoved only provides `entityID` instead `persistent_id`......
2024-05-07 12:55:55 +03:00
oguzhankoral c35f9c22ae Extract run expiration checks 2024-05-07 11:01:24 +03:00
oguzhankoral e5f861c0dc Invalidate sub elements of component if created 2024-05-07 10:39:22 +03:00
oguzhankoral 7a31143ef4 Highlight and remember received objects 2024-05-06 15:46:41 +03:00
oguzhankoral 9daa0e4059 Do not send if nothing selected 2024-05-06 12:40:54 +03:00
oguzhankoral eaedeb4f8b Implement getConnectorVersion 2024-05-06 12:13:10 +03:00
oguzhankoral bd2f1d2777 Add missing latest_version_id and has_dismissed_update_warning for receive card 2024-04-30 15:29:30 +03:00
oguzhankoral 52e43bac2d Make elements backward compatible 2024-04-29 10:11:23 +03:00
oguzhankoral daef503970 Wrap DUI3 receive into sketchup operation 2024-04-29 10:10:53 +03:00
oguzhankoral 4d0ba3cd13 Remove placeholder everything and tag send filters 2024-04-29 09:30:34 +03:00
oguzhankoral bd111a2106 Lowercase the app name 2024-04-22 11:40:39 +03:00
oguzhankoral 22daade5d2 Add EntityObserver for Edge and Vertex change detection 2024-03-25 14:24:17 +03:00
oguzhankoral a39d72a59d Change detections for entities 2024-03-25 14:24:06 +03:00
oguzhankoral 3a2e523589 Do not iterate closure table if nil 2024-03-22 12:26:25 +03:00
oguzhankoral 8bd27c6ad1 ObjectReference for previously converted objects 2024-03-21 20:13:11 +03:00
oguzhankoral 4c20cf67c8 Serializer adjustments for ObjectReference
- Previous state and sketchup entity pollution on serializer cleared up
2024-03-21 14:13:01 +03:00
oguzhankoral 337da3d523 Add option for netlify ui url 2024-03-19 14:55:41 +03:00
oguzhankoral 3050803e68 Send according to filter and expiration 2024-03-19 14:28:30 +03:00
oguzhankoral beb803fc63 Read/write cards correctly 2024-03-19 14:28:29 +03:00
oguzhankoral b056bcae2c Remove unnecessary sourceApplication 2024-03-19 14:28:29 +03:00
oguzhankoral 6a2c297640 Fix renames 2024-03-19 14:28:29 +03:00
oguzhankoral 8b3127eda4 Fix selection 2024-03-19 14:28:29 +03:00
oguzhankoral b63d51ab1d Align boilerplate config 2024-03-19 14:28:29 +03:00
oguzhankoral 3b2dfd27d6 Fix changed property for modelCardId 2024-03-19 14:28:29 +03:00
oguzhankoral b8753195df Solve post-conflicts with dev 2024-03-19 14:28:29 +03:00
oguzhankoral e76eb113a5 Zoom selection for highlight 2024-03-19 14:28:29 +03:00
oguzhankoral d285e10565 Update sqlite3 submodule hash ref 2024-03-19 14:28:29 +03:00
oguzhankoral 66803f9036 Highlight model for send cards 2024-03-19 14:28:29 +03:00
oguzhankoral d7cff48374 Remove cards from model 2024-03-19 14:28:29 +03:00
oguzhankoral d66ed0566b Add action name to error message for commands 2024-03-19 14:28:29 +03:00
oguzhankoral fde2b3bf0f First successful receive 2024-03-19 14:28:29 +03:00
oguzhankoral dcc8270cc6 Send progressbar with Sketchup.status_text
Thanks to library of thomthom
2024-03-19 14:28:29 +03:00
oguzhankoral 23b6ca7552 Send model card id via sendViaBrowserArgs 2024-03-19 14:28:29 +03:00
oguzhankoral 437173e6a4 Get source app version via base bindings 2024-03-19 14:28:29 +03:00
oguzhankoral 1274facbed Send message from sender card 2024-03-19 14:28:29 +03:00
oguzhankoral 180fc2ca59 Correct send data 2024-03-19 14:28:28 +03:00
oguzhankoral 187cf8f55e Real send via DUI3 2024-03-19 14:28:28 +03:00
oguzhankoral dd8868b2a2 Trigger sendersExpired when objects modified 2024-03-19 14:28:28 +03:00
oguzhankoral 921e8ea1a8 Use AddModel action for updateModel command 2024-03-19 14:28:28 +03:00
oguzhankoral 54e8782e12 Place binding classes into folder 2024-03-19 14:28:28 +03:00
oguzhankoral 9e690dd304 Enable error catch for command 2024-03-19 14:28:28 +03:00
oguzhankoral 373b42041b Update model card 2024-03-19 14:28:28 +03:00
oguzhankoral 30ead47fb9 Add type discriminator 2024-03-19 14:28:28 +03:00
oguzhankoral 2dc7206f17 Reorganize send bindings 2024-03-19 14:28:28 +03:00
oguzhankoral ab7594bd23 Split account binding from base 2024-03-19 14:28:28 +03:00
oguzhankoral 710a22aea7 Align with Dim's works 2024-03-19 14:28:28 +03:00
oguzhankoral 2c7c801efc WIP: selection bindings - add cards to model 2024-03-19 14:28:28 +03:00
oguzhankoral 41ebe058e7 WIP: filters 2024-03-19 14:28:28 +03:00
oguzhankoral 288c71b3e0 Convert tag colors to hex 2024-03-19 14:28:28 +03:00
oguzhankoral d7a8afcb31 Get default filters 2024-03-19 14:28:28 +03:00
oguzhankoral a1d120ee22 Get model state and send filter for sketchup 2024-03-19 14:28:28 +03:00
oguzhankoral b58d6d0d82 WIP: connector configs 2024-03-19 14:28:28 +03:00
oguzhankoral 5ab65391ca Implement config_binding 2024-03-19 14:28:28 +03:00
oguzhankoral 2b40d58996 Introduce ruby traverse_and_construct 2024-03-19 14:28:28 +03:00
oguzhankoral 96129388ec Send-Receive operations test via ruby 2024-03-19 14:28:25 +03:00
oguzhankoral 6f6058a2d1 Remove test bridge.js 2024-03-19 14:27:56 +03:00
oguzhankoral 063ef91613 Unit test for send operation 2024-03-19 14:27:56 +03:00
oguzhankoral 5233072099 Enable collect preferences 2024-03-19 14:27:56 +03:00
oguzhankoral cd063b0e8a Emit only documentChanged instead of passing data 2024-03-19 14:27:56 +03:00
oguzhankoral 719d796e20 Rename views to bindings 2024-03-19 14:27:56 +03:00
oguzhankoral 9767bf5261 Report errors to UI 2024-03-19 14:27:56 +03:00
oguzhankoral a9998bf12d Resolve triggerEvent 2024-03-19 14:27:56 +03:00
oguzhankoral 2b7dc899e1 Implement test bindings 2024-03-19 14:27:56 +03:00
oguzhankoral cbc3f51d4c Create random sketchup binding 2024-03-19 14:27:56 +03:00
oguzhankoral ff1c8c1bfe Implement on_document_changed action 2024-03-19 14:27:56 +03:00
oguzhankoral 6d4222bb1a Add command for get document info 2024-03-19 14:27:56 +03:00
oguzhankoral 7692a6f258 Remove get_commands action and command 2024-03-19 14:27:56 +03:00
oguzhankoral ed8e6b00c6 Apply same dialog-view relationship to legacy UI 2024-03-19 14:27:56 +03:00
oguzhankoral 85db9570dd Control views via dialog 2024-03-19 14:27:56 +03:00
oguzhankoral be174b9cce Remove unnecssary init from view 2024-03-19 14:27:56 +03:00
oguzhankoral f0099090b4 Collect command names from related view for SketchupBridge 2024-03-19 14:27:56 +03:00
oguzhankoral b72bdfcbf0 Pass view to commands 2024-03-19 14:27:53 +03:00
oguzhankoral e1f5addddc Send messages to correct view/binding 2024-03-19 14:23:06 +03:00
oguzhankoral 87d3145317 Solve missing resolve_id arguments for commands and actions 2024-03-19 14:23:06 +03:00
oguzhankoral 84fc89cbbe Run legacy and dui3 at the same time 2024-03-19 14:23:06 +03:00
oguzhankoral fbbddd8365 Pass resolve id from arguments 2024-03-19 14:23:06 +03:00
oguzhankoral dcfb787563 Replace Bridge with inhouse resolve_id solution 2024-03-19 14:23:06 +03:00
oguzhankoral 6822b2db9b Pass serialized accounts data as json object 2024-03-19 14:23:06 +03:00
oguzhankoral d89b3772de Pass correct request id for getAccounts 2024-03-19 14:23:06 +03:00
oguzhankoral e4a4eb0455 Request id temp hack 2024-03-19 14:23:06 +03:00
oguzhankoral 759efa7da3 Add get commands 2024-03-19 14:23:06 +03:00
oguzhankoral bf1c271784 Add bridge sample 2024-03-19 14:23:06 +03:00
oguzhankoral 9754893181 Check correct dui3 id ui controller 2024-03-19 14:23:06 +03:00
oguzhankoral 5b05182a1c Add new dialog for dui3 2024-03-19 14:23:00 +03:00
oguzhankoral 20528f72df Merge remote-tracking branch 'origin/development' 2024-03-19 13:32:03 +03:00
Alan Rynne 7de08d9f24 fix: Use correct digicert context + pass fingerprint to ISS compiler (#328)
* fix: Use correct digicert context + pass fingerprint to ISS compiler

* Update config.yml

* Update config.yml

---------

Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
2024-03-14 11:27:45 +00:00
Oğuzhan Koral d047f5e6d2 Chore (URL): CNX-9018 Do not add model from multi model urls
- warn user and return
- otherwise add
2024-02-29 15:13:44 +03:00
Oğuzhan Koral 71071f817c Make FE2 terminology default (#326) 2024-02-27 17:09:38 +03:00
oguzhankoral ad9af9bb3d Merge remote-tracking branch 'origin/development' 2024-02-27 12:38:00 +03:00
Oğuzhan Koral c7c864b8c0 Feat (CI): Update CI for digicert (#325)
* Update CI for digicert

* Checkout speckle-sharp-ci-tools branch if exist
2024-02-27 12:36:25 +03:00
Oğuzhan Koral 67d4862f6b Fix (Mapper): CNX-9027 mapped edges don't send at all (#324)
* Separate native revit object definitions

* Add types for native revit objects

* Pass speckle_state to line conversion

* Remove mapper functions from model collections

* Use dictionary pattern matching for mapping conversions

* Remove unnecessary argument from Mapper.to_speckle
2024-02-21 16:59:40 +03:00
Oğuzhan Koral 6a16327c30 Fix (Cache): CNX-8976 bug on initialization on clear setup (#323)
* Call sketchup functions before mount

* Change default to app.speckle.systems

* Use account id instead uuid to get selected account before
2024-02-20 23:54:15 +03:00
Oğuzhan Koral 060b1b8f41 Fix (Attributes): Fix typos 2024-02-15 16:43:32 +03:00
Oğuzhan Koral da2e228293 Fix (FE2): CNX-8877 bug access error by fe2 model url (#321)
* Disable reload

* Enrich selected account info and fix same user id issue

* Trigger sketchup only saved stream not exists

* Fix activeAccount

* Increase number of branches limit to 100

* Check regex match
2024-02-13 16:36:35 +03:00
Oğuzhan Koral ab7397bf55 Feat (FE2): CNX-8702 fe2 urls (#320)
* Recreate ApolloProvider whenever account switches

- It is a force-push of reload page whenever user switches account. It doesn't hurt

* Fix FE2 urls and streamWrapper flag argument
2024-02-03 02:36:41 +03:00
Oğuzhan Koral f79547f781 Reset UI location to center of SketchUp (#319) 2024-01-31 23:00:46 +03:00
Oğuzhan Koral 2152f1c90e Feat (Mapper): CNX-8309 Family instances (#318)
* Implement New Revit Family option

* Filter family types for 'Family Instance'

* Adjust available mapping methods according to selection

* Set hard coded categories just once and source families when source set/updated

* Implement family instance mapping

* Pass group selection info if only group selected

* Exclude definitions from conversion escape

- Previously we were using definition mappings only for direct shape conversions but now they can live in instances

* Add direct shape option to components back

* Calculate rotation of family instance

* Fix transformation matrix

* Use insertion point for instances

* Set inputs for mapped definition
2024-01-08 18:40:55 +03:00
Oğuzhan Koral 503fb4d246 Feat (GIS): support line element 2023-12-01 01:46:53 +03:00
oguzhankoral 2befefa752 Extract utils for line and polygon element 2023-11-30 15:07:31 +03:00
oguzhankoral 85e64c5076 Add line element support 2023-11-30 00:36:47 +03:00
Oğuzhan Koral 60523dc994 Fix (Collections): Support gis collections and none unit 2023-11-29 16:06:58 +03:00
oguzhankoral 6d780bf350 Rename GisLayerCollection as generic 2023-11-29 16:06:37 +03:00
oguzhankoral eec02a1f84 Support none unit 2023-11-29 15:58:26 +03:00
oguzhankoral ace2fe6fe3 WIP: Convert from 'meters' to 'm' 2023-11-29 13:26:53 +03:00
oguzhankoral 188794af8d Add support for vector layer 2023-11-29 13:26:53 +03:00
Oğuzhan Koral 92a941a944 Fix (Instancing): correct id of definition for speckle entity 2023-11-29 13:25:51 +03:00
oguzhankoral 0e1ddf2b11 Tweak definition speckle entity checks 2023-11-29 13:15:07 +03:00
Oğuzhan Koral b57fa010d1 Fix (Config): Reset configs if configSketchup somehow corrupted 2023-11-28 22:38:56 +03:00
oguzhankoral f816452b78 Reset configs if configSketchup somehow corrupted 2023-11-28 22:36:03 +03:00
oguzhankoral 133308141b Merge branch 'development' 2023-11-28 13:57:11 +03:00
Oğuzhan Koral 120083bb31 Feat (Performance): receive performance improvements 2023-11-28 13:54:36 +03:00
oguzhankoral a5bb5c4686 Remove logging 2023-11-28 13:31:19 +03:00
oguzhankoral e5e2729f0a Wrap receive into sketchup operation for performance improvement 2023-11-28 11:57:17 +03:00
oguzhankoral ba8b902f48 Merge coplanar faces at the end of the operation 2023-11-28 11:23:30 +03:00
oguzhankoral 2d67815ae6 Remove unused lines 2023-11-27 23:36:10 +03:00
oguzhankoral ec0c9066d2 Merge coplanar faces remove scoping and check normals first 2023-11-27 21:44:15 +03:00
Oğuzhan Koral 58ae858077 Update dev with changes in main 2023-11-13 19:45:20 +03:00
Oğuzhan Koral 613e7938b3 Fix (Scene): missing views from Revit 2023-11-13 14:35:09 +03:00
oguzhankoral e07ff1a445 Fix missing views from Revit
- Previously it was assuming views arrive in elements of collection
2023-11-13 14:15:32 +03:00
Oğuzhan Koral de7dd34ea2 Feat (FE2): Support fe2 terminology and urls 2023-11-13 12:03:19 +03:00
oguzhankoral 0552f695f9 Update FE2 terms for Mapper Tool 2023-11-10 16:49:51 +03:00
oguzhankoral b8d4f3d946 Parse FE2 urls to add projects via ADD BY ID OR URL 2023-11-10 15:52:06 +03:00
oguzhankoral fa112a70b1 Switch to FE2 as user preferences 2023-11-10 15:13:58 +03:00
oguzhankoral 97309ebb88 Merge remote-tracking branch 'origin/development' 2023-09-19 08:31:29 +03:00
Oğuzhan Koral 556ddc0b6f Feat (deploy): Mac support 🍎 2023-09-11 10:40:08 +03:00
Oğuzhan Koral a0dde690ea Fix intendation 2023-09-08 18:17:59 +03:00
Oğuzhan Koral a76dab5be6 Remove mac suffix from deploy manager 2023-09-08 18:16:15 +03:00
Oğuzhan Koral 2d10bc5bbf Deploy manager for mac 2023-09-08 18:13:15 +03:00
Oğuzhan Koral 4042632e0b Fix (Revit): Support curtain walls from revit 2023-09-08 13:37:07 +03:00
oguzhankoral 7ccf83e1a4 Consider speckle id for revit definition 2023-09-08 13:17:16 +03:00
oguzhankoral 019cd0756f Convert revit walls to native instead with display value 2023-09-08 13:16:50 +03:00
József L. Kiss 0e5f9f80be CI integration of mac build (#301)
* patcher

* patch-version

* fix 1

* fix 2

* patch_version

* revert

* mac installer

* slname

* checkout

* powershell

* SEMVER

* python

* installername

* git checkout

* cd speckle-sharp-ci-tools

* zip

* zip location

* white space

* remove checktou

---------

Co-authored-by: József L. Kiss <>
2023-09-07 17:05:02 +03:00
József L. Kiss fc6767860a Add release version of sqlit3 bundle 2023-08-17 13:05:13 +02:00
oguzhankoral 5b5b4be7b2 Mac AppData folder 2023-08-16 17:22:25 +03:00
oguzhankoral 45351d082e Add sqlite3_27.bundle for mac 2023-08-16 16:30:43 +03:00
Oğuzhan Koral 22ccd07491 Release 2.15 2023-07-25 14:48:22 +03:00
Oğuzhan Koral 2cf9ee647b Fix (Mapper): Add offset parameter to walls 2023-07-25 14:26:21 +03:00
oguzhankoral efb567824b Add offset parameter to walls 2023-07-12 13:01:16 +03:00
Oğuzhan Koral f0aac39486 Chore (Mixpanel): tracking for mapper actions 2023-07-06 10:03:08 +03:00
oguzhankoral f278055805 Correct mappings set and applied 2023-07-03 12:27:23 +03:00
oguzhankoral 6f2e36fd11 Add mixpanel tracking for mapper 2023-07-03 12:03:37 +03:00
Oğuzhan Koral 119d80ffc8 Fix (Mapper): Definition mapping 2023-06-29 22:42:36 +03:00
oguzhankoral 771c3df864 Fix definition mapping 2023-06-29 22:39:31 +03:00
Oğuzhan Koral 7d1963e458 Feat (Mapper): Revit and default wall support 2023-06-26 12:23:52 +03:00
oguzhankoral dde85972b3 Add default wall 2023-06-26 12:20:32 +03:00
oguzhankoral 5e061da910 Correct tooltips according to source state 2023-06-26 11:49:34 +03:00
oguzhankoral 46bea345de RevitWall from baseline 2023-06-26 11:33:09 +03:00
Oğuzhan Koral bc53462ad6 Chore (Mapper): Rename Floor with RevitFloor 2023-06-26 10:47:50 +03:00
oguzhankoral 884df40a1d Rename Floor with RevitFloor 2023-06-26 10:45:40 +03:00
Oğuzhan Koral b23168c067 Fix (Mapper): evaluate mapping source family data 2023-06-26 10:07:48 +03:00
oguzhankoral 5568212f15 Correct type names from source 2023-06-25 20:48:16 +03:00
oguzhankoral 79db79d799 Remove braces from mapper 2023-06-25 20:47:54 +03:00
oguzhankoral 18a4008efd Set selected level name string instead of object 2023-06-25 20:20:17 +03:00
oguzhankoral 83e4abd1ee Update family types when family updated 2023-06-23 18:37:47 +03:00
oguzhankoral 243bcfba72 Make dropdowns functional 2023-06-23 18:33:39 +03:00
Oğuzhan Koral af2c8c560f Feat (Mapper): mapper method by selection and floor creation 2023-06-22 17:27:49 +03:00
oguzhankoral 6a37f3871c Add new types as constants 2023-06-22 17:18:00 +03:00
oguzhankoral 759a388448 Register levels as speckle entity 2023-06-22 17:17:47 +03:00
oguzhankoral 360e89d7ce Separate default floor with native floor 2023-06-22 17:17:23 +03:00
oguzhankoral 64655a3284 Pass speckle state to speckle conversions to detect levels 2023-06-22 17:16:47 +03:00
oguzhankoral c58356bde8 Rename with_mapper_selection_queue with better one 2023-06-22 17:16:06 +03:00
oguzhankoral f74117632d Pass stream id to level object to create it as speckle entity 2023-06-22 17:15:23 +03:00
oguzhankoral 5f2b8b8e2b Parse family type level info from command to action 2023-06-22 17:15:00 +03:00
oguzhankoral f0ce7481fd Register clear mapper source action to commands 2023-06-22 17:14:38 +03:00
oguzhankoral 6e7a5c6140 Apply and clear mapping source by buttons instead of auto-apply 2023-06-22 17:13:52 +03:00
oguzhankoral 079c18ee19 Apply mappings also for family, type and level 2023-06-22 17:13:25 +03:00
oguzhankoral 26ef6a3815 Add clearing mapper source action 2023-06-22 17:12:18 +03:00
oguzhankoral cf6dcefe6c Separate mapper data collection from Sketchup selection 2023-06-22 17:11:41 +03:00
oguzhankoral 35590eb979 Add revit parameter object 2023-06-22 17:11:07 +03:00
oguzhankoral 583a8b8a76 Separate mapper related read functions 2023-06-20 08:18:08 +03:00
Oğuzhan Koral c6e8a664de Feat (Mapper): Fetch mapper source 2023-06-19 15:10:43 +03:00
oguzhankoral 24a5e0a579 Update levels geometrically when we have new commit 2023-06-19 12:57:48 +03:00
oguzhankoral a242c197fb Store mapper source in ruby state 2023-06-16 23:10:50 +03:00
oguzhankoral 08bdd23149 Add state for mapper 2023-06-16 21:57:13 +03:00
oguzhankoral c5b35b2d98 Notify user when selected source has new update 2023-06-16 16:23:27 +03:00
oguzhankoral 5407fecd1f Fetch source branch last commit and pass to ruby 2023-06-15 16:10:10 +03:00
oguzhankoral 12d2821d26 Add mapping source selection 2023-06-15 12:09:39 +03:00
Oğuzhan Koral 2e6d58e6a3 Feat (Mapper): mapping for default floor 2023-06-14 22:20:21 +03:00
oguzhankoral 0f0c0fd5ae Check material nil 2023-06-14 16:50:04 +03:00
oguzhankoral ef9ec1c223 Send floors with global coordinates as flat list 2023-06-14 01:11:37 +03:00
oguzhankoral f4387bae30 Send @SpeckleSchema as detached property 2023-06-13 11:50:35 +03:00
oguzhankoral 49b238a23a Extract mapped elements on selection 2023-06-13 11:49:24 +03:00
oguzhankoral 4b75c01b28 Convert sketchup faces to built elements' floor 2023-06-12 13:36:09 +03:00
Oğuzhan Koral e7f641046b Fix (Send): Do not send hidden geometries in components 2023-06-09 15:26:16 +03:00
oguzhankoral 9aaabe0fab Do not send hidden geometries in components 2023-06-09 15:24:40 +03:00
Oğuzhan Koral b6e4b711bf Feat (Edge): support rhino curve types 2023-06-09 11:19:57 +03:00
oguzhankoral 58fcfd210b Support arc and circle 2023-06-09 11:12:04 +03:00
oguzhankoral 5868b9c234 Support polycurves as displayValues 2023-06-09 09:55:52 +03:00
Oğuzhan Koral 0dc6d9cf9d Fix (DisplayValue): Use name of display value first 2023-06-08 23:42:05 +03:00
oguzhankoral 67f50cf2fd If displayValue has name use it 2023-06-08 23:39:54 +03:00
Oğuzhan Koral 8b26a4d49a Chore (DisplayValue): Better component names for displayValues 2023-06-08 23:15:07 +03:00
oguzhankoral a1d0bb0aa1 Instance name as speckle_type only 2023-06-08 23:08:25 +03:00
oguzhankoral bfe08560b1 Use speckle type instead def 2023-06-08 22:31:28 +03:00
Oğuzhan Koral ac3ac24272 Fix (Scene): Orthogonal view receiving as zoomed in 2023-06-08 14:39:07 +03:00
oguzhankoral 03e7191d0e Remove unnecessary lines on to_native 2023-06-08 14:36:39 +03:00
oguzhankoral b3a42f8723 Extract camera creation fuction to fix rubocop warnings 2023-06-08 14:34:18 +03:00
oguzhankoral 9c4b740300 Send 35mm focal length if camera is orthogonal 2023-06-08 14:27:05 +03:00
oguzhankoral 2a12bdadf2 Set camera height for isometric views 2023-06-08 14:14:34 +03:00
Oğuzhan Koral c90e8ad4d2 Feat (Face): extrudable brep faces 2023-06-08 12:23:21 +03:00
oguzhankoral 4a52c51c86 Rename returning single faces as ngon 2023-06-08 12:19:09 +03:00
oguzhankoral 0efc817ddc Remove remaining orphan edges after clean up 2023-06-07 13:06:16 +03:00
oguzhankoral fee54fc98c Do not smooth and soft single faces 2023-06-07 13:05:58 +03:00
oguzhankoral 210f751396 Return added entities too from conversion 2023-06-07 13:05:35 +03:00
Oğuzhan Koral 2e2bc3fe29 Feat (Layers): support flat layers 2023-06-06 13:35:05 +03:00
oguzhankoral a6f05f86d1 Document layer strategies 2023-06-06 13:33:37 +03:00
oguzhankoral fc144e4848 Convert layers as flat list from Rhino 2023-06-06 11:43:22 +03:00
oguzhankoral cef9531428 Log function to help write texts to local file 2023-06-06 11:42:54 +03:00
oguzhankoral abd4faefbf Move speckle entity creation from speckle object to SpeckleEntity class 2023-06-06 08:17:31 +03:00
Oğuzhan Koral 966f7aaed5 Fix (Collection): fix blender receive 2023-05-29 18:12:02 +03:00
oguzhankoral 51b59fa995 Fix typo on including string 2023-05-29 18:09:48 +03:00
oguzhankoral 0b713736bd Include also detached @elements props to displayValue 2023-05-29 18:06:05 +03:00
oguzhankoral 9e33581c66 Accept also detached @displayValue props 2023-05-29 18:05:29 +03:00
oguzhankoral b97792b596 Check only collection is model or not 2023-05-29 18:04:56 +03:00
Matteo Cominetti c0746f8eff Merge pull request #270 from specklesystems/oguzhan/hash-only-hostname-of-server-url 2023-05-25 18:17:37 +01:00
oguzhankoral a826a9d692 Hash hostname of the serverUrl 2023-05-25 20:09:32 +03:00
Oğuzhan Koral 6d04203d37 Feat (Collections): Eliminate relations for layer info 2023-05-24 15:57:47 +03:00
oguzhankoral 33b2ed8a94 Fix performance penalty 2023-05-24 14:38:27 +03:00
oguzhankoral 4f16da7ad0 Do not extract relations if from revit 2023-05-24 01:16:51 +03:00
oguzhankoral 36f92c7655 Add network object support 2023-05-24 01:00:06 +03:00
oguzhankoral 1d4f5a759e Eliminate relations for model collections 2023-05-23 23:31:02 +03:00
oguzhankoral 28af9bc811 Enable rescue block for to_native 2023-05-23 12:07:48 +03:00
oguzhankoral cf04cd4094 Check view up and direction parallel or not 2023-05-23 11:50:08 +03:00
oguzhankoral 23e9efb28a Pass layer prop through to_native methods 2023-05-23 11:49:51 +03:00
Oğuzhan Koral 57322df29c Fix (Layer): Do not send line_style if none 2023-05-22 13:57:23 +03:00
oguzhankoral fff82d34c6 Do not send line_style if none 2023-05-22 13:56:10 +03:00
Oğuzhan Koral 7211860c21 Chore (Layer): Support line styles for layers 2023-05-22 11:46:52 +03:00
oguzhankoral 9fc69044f8 Support line styles for layers 2023-05-22 11:42:51 +03:00
Oğuzhan Koral 76467c3e81 Fix (Blocks): Eliminate nil block geometries 2023-05-19 19:36:28 +03:00
oguzhankoral 4cfc04e2f3 Eliminate nil block geometries 2023-05-19 19:13:15 +03:00
Oğuzhan Koral 6bfc7771d0 Fix (Face): Merge coplanar doesn't work some cases 2023-05-19 12:26:24 +03:00
oguzhankoral 7055135257 Return nil if layer path nil 2023-05-19 12:20:55 +03:00
Oğuzhan Koral 85312cf20d Fix (Mapper): inconsistency on mapped elements table state 2023-05-16 13:36:27 +03:00
oguzhankoral 4051cae5b0 Clear cached element and category selection when mapped elements updated 2023-05-16 13:27:02 +03:00
oguzhankoral c64bb6dedf Include instances for button reactions
- Clear, Isolate, Hide, Select
2023-05-16 13:25:41 +03:00
Oğuzhan Koral 7bb17ae0db Fix (Collections): Add layer property to objects as full path 2023-05-16 08:39:06 +03:00
oguzhankoral 3244eb9b15 Add layer property to objects as full path
This is for receiving on Rhino
2023-05-16 08:33:42 +03:00
Oğuzhan Koral 6e173847ba Fix (Performance): Smooth only non-planar quad meshes 2023-05-15 13:53:56 +03:00
oguzhankoral 8cbc1f763d Smooth only non-planar quad meshes 2023-05-15 13:40:31 +03:00
Oğuzhan Koral 2d45abeb28 Release 2.14.0
Merging 2.13 hotfixes into dev branch
2023-05-15 13:17:54 +03:00
oguzhankoral 2fd0ad77bc Fix or disable rubocop issues 2023-05-15 13:14:32 +03:00
oguzhankoral 53c1167831 Remove orthogonality checks 2023-05-15 13:04:22 +03:00
oguzhankoral 48d4a1d7bb Add plane_utils to calculate planarity of 4 points for quad meshes 2023-05-15 13:04:19 +03:00
oguzhankoral 4bbbba6e89 Split all quad meshes 2023-05-15 13:03:22 +03:00
oguzhankoral 0a13575325 Disable rubocop for to_native 2023-05-15 13:02:12 +03:00
Oğuzhan Koral d6075209df Fix (Update): Check if branch instance is deleted 2023-05-12 12:53:19 +03:00
oguzhankoral 9d1b39422b Extract entities_updated method 2023-05-12 12:39:37 +03:00
oguzhankoral 38e297d32b Correct condition for is_update_commit 2023-05-12 11:31:23 +03:00
oguzhankoral 459ef3c9f1 Check if branch instance is deleted 2023-05-12 11:21:34 +03:00
Oğuzhan Koral 3bb12487ba Feat (QGIS): Attribute support for qgis commits 2023-05-12 10:13:44 +03:00
oguzhankoral 8b2428c60d Workaround for QGIS geometry objects or arrays 2023-05-10 17:26:47 +03:00
oguzhankoral f9befd9051 Write qgis attributes to components 2023-05-10 12:43:29 +03:00
oguzhankoral 1020a9bd5d Wrap PolygonElement object into component 2023-05-10 12:07:40 +03:00
Oğuzhan Koral 2844c4ea86 Fix (Instance): Disable aligning axes of displayValue components 2023-05-08 16:54:52 +03:00
oguzhankoral 3344188fee Disable aligning axes of displayValue components 2023-05-08 16:44:10 +03:00
Oğuzhan Koral 67138c2f78 Fix (Update): Update behavior for Revit > Sketchup 2023-05-08 13:21:31 +03:00
oguzhankoral f59d19ef21 Check children changed or not for upcoming blocks 2023-05-08 13:13:53 +03:00
Oğuzhan Koral d0fa7e638f Feat (Collections): Model collections 2023-05-08 09:46:44 +03:00
oguzhankoral 63011e466e Change relation speckle types to collections 2023-05-08 09:34:47 +03:00
oguzhankoral 92d1976300 Split collections into helper classes 2023-05-04 20:08:17 +03:00
oguzhankoral a0cdc9fa07 Check sketchup entities for respomding true to layer set, if so set 2023-05-04 12:22:02 +03:00
oguzhankoral 60f0006597 Remove old layer helper methods 2023-05-04 12:06:56 +03:00
oguzhankoral 67a3c62a08 Align instance axes that created from displayValues without transform 2023-05-03 18:23:58 +03:00
oguzhankoral 21d5dc1e0b Remove layer argument passing for all to_native methods 2023-04-27 17:59:39 +01:00
oguzhankoral 0d810f59f9 Place received objects into correct layers 2023-04-27 17:39:15 +01:00
oguzhankoral dba60b700f Layer relations to native layer tree 2023-04-27 17:21:20 +01:00
oguzhankoral ad9a56bd20 Remove unused methods 2023-04-27 16:16:15 +01:00
oguzhankoral 82585e9104 Convert views to native with traversal method 2023-04-27 16:14:20 +01:00
oguzhankoral dfbb241b0b Model collections on send 2023-04-27 14:56:59 +01:00
oguzhankoral f69ea91f45 Add query for layers 2023-04-26 16:44:11 +01:00
oguzhankoral 768d916092 Convert scenes to view3d on class 2023-04-26 16:44:00 +01:00
oguzhankoral c0acecae10 Query methods for direct shapes 2023-04-26 16:43:31 +01:00
oguzhankoral f741d1c7e4 Clean converter from object specific functions 2023-04-26 16:43:03 +01:00
oguzhankoral d25c70f1d1 Do not load bootstrap again when reload triggered 2023-04-26 16:42:06 +01:00
oguzhankoral 6f954467ef Move collections into related namespace 2023-04-26 16:41:37 +01:00
oguzhankoral 867987a5f5 Group meshes also according to layers 2023-04-26 14:39:52 +01:00
oguzhankoral 61e0a6351c Init collection class 2023-04-14 10:09:44 +03:00
oguzhankoral 558264c23b Add documentation to app methods 2023-04-13 13:57:37 +03:00
oguzhankoral cf7aa371af Move view related methods to related class 2023-04-12 20:04:17 +03:00
oguzhankoral ffedaf6a73 Fix bug on views receive 2023-04-12 14:02:50 +03:00
oguzhankoral d9ae272b36 Proof of concept of layer relations
# Conflicts:
#	speckle_connector/src/convertors/to_speckle.rb
#	speckle_connector/src/speckle_objects/geometry/mesh.rb
#	speckle_connector/src/speckle_objects/other/block_definition.rb
#	speckle_connector/src/speckle_objects/other/block_instance.rb
2023-04-12 12:56:59 +03:00
Oğuzhan Koral 3c5d1f5c9e Fix (References): missing namespaces 2023-04-12 11:09:03 +03:00
oguzhankoral b69b8b7585 Fix missing references after couple of implementation 2023-04-12 10:44:15 +03:00
Oğuzhan Koral 8c7e498fb2 Fix (Security): Bump sqlite3 from 5.0.8 to 5.1.5 in /ui 2023-04-10 14:42:56 +03:00
dependabot[bot] 359413a296 Bump sqlite3 from 5.0.8 to 5.1.5 in /ui
Bumps [sqlite3](https://github.com/TryGhost/node-sqlite3) from 5.0.8 to 5.1.5.
- [Release notes](https://github.com/TryGhost/node-sqlite3/releases)
- [Commits](https://github.com/TryGhost/node-sqlite3/compare/v5.0.8...v5.1.5)

---
updated-dependencies:
- dependency-name: sqlite3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 11:19:39 +00:00
Oğuzhan Koral cef7d894c4 Fix (Security): Bump git from 1.12.0 to 1.18.0 2023-04-10 14:15:16 +03:00
dependabot[bot] 7d9cc1aacc Bump git from 1.12.0 to 1.18.0
Bumps [git](https://github.com/ruby-git/ruby-git) from 1.12.0 to 1.18.0.
- [Release notes](https://github.com/ruby-git/ruby-git/releases)
- [Changelog](https://github.com/ruby-git/ruby-git/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ruby-git/ruby-git/compare/v1.12.0...v1.18.0)

---
updated-dependencies:
- dependency-name: git
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 11:12:22 +00:00
Oğuzhan Koral a6780a756b Feat (Mapper): Mapper tool for direct shapes 2023-04-10 14:05:44 +03:00
Oğuzhan Koral 4e37d17b42 Feat (Mapper): Mapped elements table and it's buttons 2023-04-10 13:48:19 +03:00
oguzhankoral 793923348f Switch button for isolate/show-all accoding to state 2023-04-10 13:37:04 +03:00
oguzhankoral 700db1788d Improve performance dramatically of isolate 2023-04-08 00:02:52 +03:00
oguzhankoral 68a5a44702 Make functional buttons for mapped elements 2023-04-07 20:16:00 +03:00
oguzhankoral 464891f5a1 Manage state of selected elements and existing elements 2023-04-07 11:33:05 +03:00
oguzhankoral d2e5db2680 Custom data table header for child tables 2023-04-06 22:59:46 +03:00
oguzhankoral a9c41d0545 Connect data relationship between parent and childeren data tables 2023-04-05 17:19:21 +03:00
oguzhankoral 0bc458d307 Connect nested data tables with their v-model 2023-04-05 13:54:05 +03:00
oguzhankoral 36c7cc285e Update vuetifyjs to 2.6.10 2023-04-05 13:52:56 +03:00
oguzhankoral f9fbd31a0f Wrap data table with container 2023-04-03 16:43:19 +03:00
oguzhankoral 8789c1f855 Extract mapped elements from mapper component 2023-04-03 15:41:04 +03:00
oguzhankoral f65073480a Apply mixed mapping name 2023-04-03 15:04:20 +03:00
oguzhankoral 157ed831a7 Shrink v-cards for map selection between component-definition 2023-03-31 23:19:19 +03:00
oguzhankoral 0799a59a15 Get info from definition about number of instances 2023-03-31 23:18:23 +03:00
Oğuzhan Koral 60ea3e83e1 Fix (DirectShape): Nested objects material 2023-03-31 19:57:46 +03:00
oguzhankoral 4b874deb50 Don't add mapped entities to layer groups 2023-03-31 19:55:12 +03:00
oguzhankoral 6726b9ad50 Fix nested material issıe 2023-03-31 19:54:29 +03:00
Oğuzhan Koral 75e6fe609e Fix (Mapper): Direct shape objects on viewer 2023-03-31 15:28:05 +03:00
oguzhankoral b40d1ccf7d Send directShapes collection as detached 2023-03-31 15:26:13 +03:00
Oğuzhan Koral 4f7ba23904 Feat (Mapper): Enable multiple mapping apply and clear 2023-03-31 14:33:41 +03:00
oguzhankoral 49084706f2 Enable multiple mapping apply and clear 2023-03-31 14:31:49 +03:00
Oğuzhan Koral 1852e5f6bf Chore (Mapper): Show default values for selected entity 2023-03-30 20:33:59 +03:00
oguzhankoral be0ed5428a Apply default values from selected entity 2023-03-30 20:31:16 +03:00
oguzhankoral f428efde6a Mark mapped cards and make active one 2023-03-30 19:56:49 +03:00
oguzhankoral e79f04f33e Remove unnecessary statement 2023-03-30 15:59:33 +03:00
oguzhankoral 04db8c281f Remove selected rows which was unneccessary 2023-03-30 15:59:03 +03:00
oguzhankoral 2681698186 Disable definition option for groups
- This is uncessary since each group has it's own unique definition on sketchup
2023-03-30 15:49:04 +03:00
Oğuzhan Koral 1682c66da6 Feat (Mapper): Read mapped elements on document load 2023-03-29 23:20:29 +03:00
oguzhankoral 38bc1032d8 Read mapped entities on document load model 2023-03-29 23:18:05 +03:00
Oğuzhan Koral ba37eef9ca Feat (Mapper): Group meshes also for base geometries of direct shapes 2023-03-29 22:49:30 +03:00
oguzhankoral 3db179882a Group direct shape meshes by material 2023-03-29 22:45:45 +03:00
oguzhankoral ba8f25a807 Move mesh related methods from definition 2023-03-29 22:44:06 +03:00
oguzhankoral eac3d3089b Find entities on active path 2023-03-29 22:43:13 +03:00
Oğuzhan Koral 0454a9e147 Fix (Mapper): Group global transformations for direct shapes 2023-03-29 21:03:13 +03:00
oguzhankoral f390cd1c68 Fix/disable rubocop issues 2023-03-29 21:02:49 +03:00
oguzhankoral aaa1ba5aa9 Apply parent's material to direct shape faces 2023-03-29 20:58:57 +03:00
oguzhankoral fb9556abd9 Fix sub elements transform 2023-03-29 20:58:35 +03:00
Oğuzhan Koral 3cfb3b1f84 Feat (Mapper): Show mapped elements on table 2023-03-29 14:54:21 +03:00
oguzhankoral b071bab137 Collect mapped entities when mapper mounted 2023-03-29 14:49:48 +03:00
oguzhankoral 5dbc68ea76 State management for mapped elements 2023-03-29 14:45:09 +03:00
oguzhankoral e76fbc3b77 Notify user after apply or clear mapping 2023-03-29 13:12:59 +03:00
oguzhankoral 09ca0514d1 Remove mapping word from buttons 2023-03-29 12:57:12 +03:00
oguzhankoral faec32a5bb Remove attribute dictionary completely if mappings cleared 2023-03-29 12:35:56 +03:00
oguzhankoral 1f5793ab79 Nil check for reading objects from scratch 2023-03-29 11:50:03 +03:00
oguzhankoral df22bd1cec Fallback to definition schema of instance 2023-03-29 11:47:21 +03:00
oguzhankoral 61dba4e78d Return false if entities are missing for base_and_entities 2023-03-29 11:44:58 +03:00
Oğuzhan Koral bb678117f8 Feat (Mapper): UI communication with Sketchup 2023-03-28 21:36:12 +03:00
oguzhankoral 2dc08e71b7 Collect also instances that definitions' mapped 2023-03-28 21:02:21 +03:00
oguzhankoral df2f844e74 Styles for entity selection to map 2023-03-28 20:11:52 +03:00
oguzhankoral 621c602fc0 Make narrower scrool bar 2023-03-28 20:11:15 +03:00
oguzhankoral f809169757 Fetch definition schema from selection 2023-03-28 20:10:59 +03:00
oguzhankoral 848b135612 Clear mappings 2023-03-28 20:10:26 +03:00
oguzhankoral db6af66705 Fill inputs according to selection 2023-03-28 02:34:55 +03:00
oguzhankoral 728e1f5a86 Send categories as key-value pair objects 2023-03-28 02:34:38 +03:00
oguzhankoral d02d95bc9e Apply mapping command and action 2023-03-28 02:34:13 +03:00
oguzhankoral c1180c5373 Trigger sketchup action to apply mappings 2023-03-28 01:49:17 +03:00
oguzhankoral 4e01fb64e6 Track objects from selection table and prepare mapping 2023-03-28 01:46:21 +03:00
oguzhankoral d0fcb1da34 Add theme colors for mapper active entity cards 2023-03-28 01:45:44 +03:00
oguzhankoral 48352d06b3 Extend selected entity data from sketchup 2023-03-28 01:45:18 +03:00
oguzhankoral d995652569 Get info from last selected entity 2023-03-27 18:57:42 +03:00
oguzhankoral 5a958fa51c Split class names with space 2023-03-27 18:57:13 +03:00
oguzhankoral cfb9e2cacd Print mapped count to selection table 2023-03-27 18:12:08 +03:00
oguzhankoral 7932fc1cab Send entity persistent_id to UI 2023-03-27 18:11:40 +03:00
oguzhankoral e0fc1715b5 Create data table for selection 2023-03-27 14:54:19 +03:00
oguzhankoral 1cfd6caa64 Read object schemas from selection with their type 2023-03-27 14:54:01 +03:00
oguzhankoral 54bf18888d Helper method definition to group objects by property value 2023-03-27 14:53:23 +03:00
Oğuzhan Koral 6b60fc4259 Feat (Observers): Selection observers to collect data 2023-03-24 19:37:20 +03:00
oguzhankoral 216af8697c Create accordion for mapper 2023-03-24 17:33:42 +03:00
oguzhankoral d97e7314d0 Add categories to fake data 2023-03-24 17:33:11 +03:00
oguzhankoral 67d9dda143 Sample interactions 2023-03-24 13:06:55 +03:00
oguzhankoral 5c60e303cb Move mapped_with_schema method to reader 2023-03-24 12:36:45 +03:00
oguzhankoral e36b8f3a56 Create selection observer to trigger UI 2023-03-24 12:36:21 +03:00
Oğuzhan Koral 1e7a19b463 Chore (UI): UI components for mapping tool 2023-03-24 12:30:55 +03:00
oguzhankoral 8004249a29 Init mapper with tab 2023-03-23 16:08:36 +03:00
Oğuzhan Koral 6cd800e4ef Feat (Mapping): Send direct shape PoC 2023-03-23 12:54:42 +03:00
oguzhankoral e182bc7ed2 Clean unused methods 2023-03-22 21:38:23 +03:00
oguzhankoral c338d51c9d Skip faces into definitions if it is mapped 2023-03-22 21:19:11 +03:00
oguzhankoral c1912250df Do definition check in advance and that's why definitions argument removed 2023-03-22 21:18:50 +03:00
oguzhankoral 994c41980e Init definitions and render_materials for later caching 2023-03-22 21:18:03 +03:00
oguzhankoral 385b7a514d Transform mesh if global_transformation defined 2023-03-22 21:17:25 +03:00
oguzhankoral 3aaade9228 Entity queries for parental relationships 2023-03-22 21:16:58 +03:00
oguzhankoral b4dd19b711 Split direct shape conversion from generic conversion 2023-03-22 21:06:53 +03:00
oguzhankoral 9e9b83b4ba Init direct shape definition 2023-03-22 21:06:14 +03:00
oguzhankoral 5ff5114669 Add revit categories dictionary 2023-03-21 19:55:44 +03:00
oguzhankoral f63039f3fb Change module name with revit specific 2023-03-21 19:53:47 +03:00
oguzhankoral b39399463d Add speckle schema to objects for to speckle 2023-03-21 14:17:36 +03:00
oguzhankoral 8217ef7fbb Create speckle schema dictionary handler 2023-03-21 14:17:18 +03:00
oguzhankoral b4851c34e1 Separate base dictionary_handler from root 2023-03-21 14:16:52 +03:00
Oğuzhan Koral 8e39832d3e Fix (Instancing): Definition uniqueness for mirrored definitions 2023-03-20 22:14:10 +03:00
oguzhankoral ce7ac6da16 Create definitions with it's id 2023-03-20 22:11:52 +03:00
oguzhankoral 57879a57cd Enable conversion for full assembly name block instance 2023-03-20 22:05:42 +03:00
Oğuzhan Koral 6f5b367028 Fix (Revit): Do not create layers in advance for revit receives 2023-03-20 13:04:42 +03:00
oguzhankoral 291948c1ef Do not create layers in advance for revit receives 2023-03-20 12:57:26 +03:00
Oğuzhan Koral 0ca6888fb1 Fix (Instancing): Support nested families re-fix 2023-03-20 10:56:50 +03:00
oguzhankoral 5e92236396 Remove skp attributes from transform 2023-03-20 10:45:45 +03:00
oguzhankoral 28db40112b Collect revit elements also into displayValue to handle later 2023-03-20 10:45:13 +03:00
Oğuzhan Koral b2153883ef Revert "Fix (Instancing): Support nested families" 2023-03-16 18:28:44 +03:00
Oğuzhan Koral 807cbeb75d Revert "Fix (Instancing): Support nested families" 2023-03-16 18:28:14 +03:00
Oğuzhan Koral 4730aebdc6 Fix (Instancing): Support nested families 2023-03-16 18:06:50 +03:00
oguzhankoral c2279eec87 Add elements of revit_definition to display value to handle all 2023-03-16 18:03:21 +03:00
Oğuzhan Koral f5567ae9ad Chore (Mixpanel): Send isMultiplayer parameter with Receive action 2023-03-16 11:50:45 +03:00
oguzhankoral 2fcba04cf5 Pass sourceHostApp with slug and sourceHostAppVersion full info on commit
For "Revit2022",
sourceHostApp: "revit"
sourceHostAppVersion: "Revit2022"
2023-03-16 11:13:49 +03:00
oguzhankoral 0eefd1605f Add static HostApplication instances per connector
- This helps to retrieve name and slug of the connector
2023-03-16 11:12:29 +03:00
oguzhankoral 7b88ea022d Send isMultiplayer parameter with Receive action 2023-03-15 12:35:57 +03:00
Oğuzhan Koral 7a922114ab Fix (Instancing): Split revit instance from block instance 2023-03-14 21:18:22 +03:00
oguzhankoral f717c270fd Collect views according to speckle_type 2023-03-14 21:16:56 +03:00
oguzhankoral ee5ed468c3 Fix rubocop issues 2023-03-14 20:18:28 +03:00
oguzhankoral a9ded445a7 Separate revit instance from block instance 2023-03-14 20:08:02 +03:00
oguzhankoral 9ecad52df2 Dont create speckle entity for sketchup materials 2023-03-14 17:48:20 +03:00
oguzhankoral 8c500985bf Flip soft edge check with hard edge 2023-03-14 16:37:16 +03:00
Oğuzhan Koral 3567f9ba5d Fix (Layers): Update level object's layer to Levels 2023-03-14 14:42:01 +03:00
oguzhankoral 852bfb716c Update level object's layer to Levels 2023-03-14 14:39:19 +03:00
Oğuzhan Koral 473956aa3c Fix (Update): Update behavior 2023-03-14 11:33:25 +03:00
oguzhankoral b22fc19400 Register component and groups by default for update behavior 2023-03-14 11:31:17 +03:00
oguzhankoral f6a8ece992 Check existing scene names to prevent duplications 2023-03-14 11:28:28 +03:00
oguzhankoral afc0c21aae Swap branch and stream name for commit obj 2023-03-14 11:10:05 +03:00
Oğuzhan Koral 08e6106c1f Fix (Levels): Levels should be visible 2023-03-13 14:20:01 +03:00
oguzhankoral 1f9f654e3d Add levels as cline 2023-03-13 14:11:10 +03:00
oguzhankoral 501e923760 Add section planes into received component
By this way these section planes will be active only in this commit objects
2023-03-13 09:58:32 +03:00
Oğuzhan Koral 37b716cfc5 Feat (Scene): Create scenes from revit views 2023-03-12 23:46:14 +03:00
oguzhankoral 8584db0ab5 Create scenes from revit views 2023-03-12 23:41:00 +03:00
Oğuzhan Koral 5aff3e9692 Feat (Instancing): Definition naming convention 2023-03-10 18:06:48 +03:00
oguzhankoral 5d8f03cbc3 Fix rubocop suggestions 2023-03-10 18:04:14 +03:00
oguzhankoral b6c85ac15a Group received objects with branch and stream name 2023-03-10 17:57:43 +03:00
oguzhankoral c2af757f4e Collect received objects under component 2023-03-10 16:08:17 +03:00
oguzhankoral 26252c55ac Pass branch and stream name to to_native converter 2023-03-10 16:07:34 +03:00
oguzhankoral 3ce547bcea Update naming convention 2023-03-09 19:04:01 +03:00
oguzhankoral e0492f589e Update will be soften list 2023-03-09 19:03:49 +03:00
oguzhankoral 4931288ffd Update will be hidden layers list 2023-03-09 19:03:26 +03:00
oguzhankoral 52e0f77a3c Remove category from definition names 2023-03-09 16:12:47 +03:00
Oğuzhan Koral 20c016f1bf Feat (Layers): revit categories as tags 2023-03-09 14:24:47 +03:00
oguzhankoral 00a271cbba Create tags for missing categories 2023-03-09 14:24:08 +03:00
oguzhankoral 3a6b69634d Hide specific revit layers
- Rooms, Mass, Mass Floor
2023-03-09 13:36:39 +03:00
Oğuzhan Koral 78cf7f42e3 Feat (Instancing): Support instancing 2023-03-08 23:56:53 +03:00
oguzhankoral 2b52454c00 Extract collect_definition_geometries for display value 2023-03-08 23:56:10 +03:00
oguzhankoral e032e4561b Receive unique elements with element id even if they have same type 2023-03-08 23:41:42 +03:00
oguzhankoral 23ce1e0476 Make soft edge according to definition name 2023-03-08 23:35:47 +03:00
oguzhankoral 825b7b98d7 Fix rubocop suggestions 2023-03-08 23:35:26 +03:00
oguzhankoral 3de3128a2a Cover mullions by including their elements 2023-03-08 23:34:56 +03:00
oguzhankoral 92d70ccc8b Support Objects.Other.Revit.RevitInstance 2023-03-08 23:33:14 +03:00
oguzhankoral f8c5154457 Remove TransparencySort option from model
- It does not make sense anymore
2023-03-08 23:32:35 +03:00
Oğuzhan Koral 3a3874e9f1 Feat (RevitLevels): Revit levels to Sketchup section planes 2023-03-08 20:31:51 +03:00
oguzhankoral 61b94c519b Update TransparencySort value to 3 by default 2023-03-08 14:39:58 +03:00
oguzhankoral ac0f46ca66 Update unique definitions for revit objects 2023-03-08 14:17:05 +03:00
oguzhankoral e538cdb509 Create levels from objects 2023-03-08 14:16:46 +03:00
oguzhankoral df8a63c5f5 By default set DisplaySectionPlanes is true 2023-03-08 14:16:23 +03:00
oguzhankoral 6827a61bf8 Simplify convert_to_speckle_entities logic 2023-03-08 12:32:52 +03:00
Oğuzhan Koral 20e56c05b3 Feat (Receive): Receive objects as speckle entity 2023-03-07 15:30:59 +03:00
oguzhankoral 5494139319 Disable rubocop issues 2023-03-07 15:28:25 +03:00
oguzhankoral c491ba087a Implement another user setting to activate continuous traversal 2023-03-07 15:17:38 +03:00
oguzhankoral 5cf045c941 Collect speckle materials from sketchup model 2023-03-07 15:17:16 +03:00
oguzhankoral 55fea5f077 Add definitions as collection 2023-03-07 15:16:47 +03:00
oguzhankoral 3a9cb73950 Implement dynamic to_native methods to objects 2023-03-07 15:14:12 +03:00
oguzhankoral d99f613b79 Return combined faces from clean_up 2023-03-07 15:13:33 +03:00
oguzhankoral 68db8ddff3 Add type constants 2023-03-07 15:12:50 +03:00
oguzhankoral c7490b264b Pass stream id to converter by default 2023-03-07 15:11:34 +03:00
Oğuzhan Koral a8e84cfad3 Chore (Query): Query source application from commit 2023-02-28 16:03:56 +03:00
oguzhankoral 5ec4f7e4e8 Pass source application info to command and action 2023-02-28 15:54:04 +03:00
oguzhankoral b019ce2f2e Update stream query for commit sourceApplication 2023-02-28 15:53:41 +03:00
Oğuzhan Koral dd90e41610 Fix (Instance): Component instance naming 2023-02-27 10:43:20 +03:00
oguzhankoral bdf78e374d Update diffing icon with eye instead triangle 2023-02-27 10:27:16 +03:00
oguzhankoral 163197f583 Do not set speckle id as instance name as fallback
Now as is
2023-02-27 10:26:53 +03:00
oguzhankoral 8e13bba44a Write always entity dictionaries while converting
This was tightly coupled with diffing before, now it is separated. It's better.
2023-02-27 10:26:03 +03:00
Oğuzhan Koral e4478b86a5 Feat (SpeckleEntity): Read speckle entities when model loaded 2023-02-27 09:01:12 +03:00
oguzhankoral 1b1ae59ed7 Read speckle entities from sketchup model 2023-02-24 19:18:16 +03:00
oguzhankoral a54f44d22a Update init method of speckle entity with more general way 2023-02-24 19:18:03 +03:00
oguzhankoral d2394274eb Simplify speckle entity object
- So entity specific objects removed
2023-02-24 19:17:18 +03:00
Oğuzhan Koral 0eedb0b397 Chore (Mixpanel): Mixpanel alignment 2023-02-24 10:59:45 +03:00
oguzhankoral 782e9db1f6 Align mixpanel event names 2023-02-24 10:10:50 +03:00
Oğuzhan Koral 2977472c56 Feat (Preferences): Validate model and user preferences 2023-02-22 13:02:18 +03:00
oguzhankoral 8f3a8bfa91 Validate user and model preferences while reading 2023-02-22 12:53:26 +03:00
Oğuzhan Koral 914f6e9516 Fix (Model): Update preferences on state and UI when model has changed 2023-02-21 13:01:53 +03:00
oguzhankoral fa6f65cb7c Use handler methods instead watchers per switch 2023-02-21 12:57:24 +03:00
oguzhankoral dafbe6f995 Update preferences on state and UI when model has changed 2023-02-21 10:47:49 +03:00
Oğuzhan Koral 4a8ac6377b Fix (Preferences): Validate preferences if data is incomplete 2023-02-20 16:47:55 +03:00
oguzhankoral c91fac4ec4 Validate preferences if data is incomplete 2023-02-20 16:30:46 +03:00
Oğuzhan Koral 00d23b084e Chore (Attributes): Send receive attributes as deserialized 2023-02-20 14:58:21 +03:00
oguzhankoral e0a3b82cea Send receive attributes as deserialized 2023-02-20 14:56:01 +03:00
Oğuzhan Koral e49036d8c4 Chore (Attributes): Send and receive ifc classifications 2023-02-20 13:36:52 +03:00
oguzhankoral 4a8356692b Send and receive classifications for component definitions 2023-02-20 13:30:31 +03:00
Oğuzhan Koral adfb7bc63a Fix (BlockDefinition): align detach properties 2023-02-20 12:44:35 +03:00
oguzhankoral 3f41cefa88 Remove basePoint from definition 2023-02-20 12:38:57 +03:00
oguzhankoral 2074ff1987 Rename blockDefinition to definition for BlockInstance 2023-02-20 11:18:50 +03:00
Oğuzhan Koral 65fe189421 Feat (Views): Expand scene support 2023-02-17 22:27:43 +03:00
oguzhankoral bb7590eab4 Simplify sending rendering_options 2023-02-17 22:22:26 +03:00
oguzhankoral 6a04457219 Send and receive rendering options of scenes 2023-02-17 21:51:44 +03:00
oguzhankoral 7f8b1d9586 Include update properties to scenes 2023-02-17 15:39:00 +03:00
Oğuzhan Koral 4362cc53bb Feat (Diffing): MVP for continuous traversal
Fixed issues:
- Origin Point of Components Visible in the Viewer
- Align detach properties with other connectors
- MVP for continuous traversal
- Create SpeckleEntity object as state holder
2023-02-17 02:26:47 +03:00
oguzhankoral 959e6b2a12 Fix rubocop issues 2023-02-17 02:23:27 +03:00
oguzhankoral 2d91070e5a Distint detached properties and dynamically detached properties 2023-02-17 02:17:00 +03:00
oguzhankoral cc038ece32 Remove bbox from mesh 2023-02-17 02:16:59 +03:00
oguzhankoral 7af1292f29 Add setting for diffing 2023-02-17 02:16:59 +03:00
oguzhankoral 2c3fd7a84f Update preferences if empty or has incomplete data 2023-02-17 02:16:59 +03:00
oguzhankoral d36f70dbc7 Align base object serializer with continuous traversal 2023-02-17 02:16:59 +03:00
oguzhankoral 77f5f29c90 Rename batch logging method 2023-02-17 02:16:58 +03:00
oguzhankoral ead45ed843 Remove applicationId from clean base object before traverse props 2023-02-17 02:16:58 +03:00
oguzhankoral a6259bb7eb Print on Speckle folder 2023-02-17 02:16:58 +03:00
oguzhankoral 0249ebeb95 Move is_detached to old order 2023-02-17 02:16:57 +03:00
oguzhankoral 1c3a35a137 Fill delta icon if diffing active on stream 2023-02-17 02:16:57 +03:00
oguzhankoral c12319b417 Activate and deactivate diffing for streams safely 2023-02-17 02:16:57 +03:00
oguzhankoral 90ac00a628 Pass stream if to speckle entities 2023-02-17 02:16:57 +03:00
oguzhankoral e5c71cb3a4 Handle speckle entity dictionaries according validation of object 2023-02-17 02:16:56 +03:00
oguzhankoral ebf0681574 Collect invalid streams from speckle_state 2023-02-17 02:16:56 +03:00
oguzhankoral 642643f412 Remove unnecssary implementation for entity utis 2023-02-17 02:16:56 +03:00
oguzhankoral 8dd65ac255 Init diffing materials with plugin initialization 2023-02-17 02:16:55 +03:00
oguzhankoral 8df58f226b Invalida speckle entities when they edited 2023-02-17 02:16:55 +03:00
oguzhankoral 58b4f2ce14 Disable observers on commands 2023-02-17 02:16:55 +03:00
oguzhankoral 65f0c836fe Align objects with continuous traversal 2023-02-17 02:16:55 +03:00
oguzhankoral 2aa16085a5 Return converted entities regardless 2023-02-17 02:16:54 +03:00
oguzhankoral 25f05a69c6 Return new speckle_state from serializer 2023-02-17 02:16:54 +03:00
oguzhankoral 5c2a94da16 Align speckle entities with traversed objects 2023-02-17 02:16:54 +03:00
oguzhankoral 162325e90e Add desktop path to constants 2023-02-17 02:16:54 +03:00
oguzhankoral b022a8c608 Implement observers 2023-02-17 02:16:53 +03:00
oguzhankoral 1e404f5e6b Return converted and traversed versions from entities 2023-02-17 02:16:53 +03:00
oguzhankoral 8ef7780332 Write application_id to dictionary of SpeckleEntity 2023-02-17 02:16:53 +03:00
oguzhankoral 51b4f7b3f7 Use definition persistent id for nested block definitions 2023-02-17 02:16:53 +03:00
oguzhankoral 9b3fa33e50 Save traversed object details into SpeckleEntity's dictionary 2023-02-17 02:16:52 +03:00
oguzhankoral 9349d0813d Implement speckle_block_instance_entity 2023-02-17 02:16:52 +03:00
oguzhankoral 8d9bc500a1 Write traversed info to speckle entity's dictionary 2023-02-17 02:16:52 +03:00
oguzhankoral cae7b6e29f Add line and mesh speckle entities 2023-02-17 02:16:51 +03:00
oguzhankoral 0b4ac732b2 Fix traversal missing references 2023-02-17 02:16:51 +03:00
oguzhankoral acacbb91e3 Add single unit test for line traversing 2023-02-17 02:16:51 +03:00
oguzhankoral fd6d3d9a2f Pass state to converters 2023-02-17 02:16:51 +03:00
oguzhankoral 3b531e30b1 Disable caching temporarly 2023-02-17 02:16:50 +03:00
oguzhankoral 0c78085b2e Remove command data from console logging 2023-02-17 02:16:50 +03:00
oguzhankoral 4ab53308f7 Initialize relations on to_speckle 2023-02-17 02:16:50 +03:00
oguzhankoral 06ae161793 Check base object already traversed or not 2023-02-17 02:16:50 +03:00
oguzhankoral 94e005d2f8 Fix speckle_state immutable update on state 2023-02-17 02:16:49 +03:00
oguzhankoral 717072c3a5 Introduce speckle_entity objects 2023-02-17 02:16:49 +03:00
oguzhankoral 02b4bde92a Add speckle state for serialization process 2023-02-17 02:16:49 +03:00
oguzhankoral a397d1e233 Return speckle state from traversal methods 2023-02-17 02:16:45 +03:00
Oğuzhan Koral d2198c0765 Improve refreshMixpanelIds function with better registration 2023-02-17 02:16:28 +03:00
oguzhankoral 549bf63198 Improve refreshMixpanelIds function with better registration and identifying 2023-02-16 16:26:00 +03:00
Oğuzhan Koral 8b824f5342 Update innosetup workflow
There were issues with innosetup workflow which does not run one powershell.exe,
so workflows splitted into chunks according to shells
2023-02-08 21:20:17 +03:00
oguzhankoral d052d5e8a1 Change set env variable to run with powershell 2023-02-08 21:12:00 +03:00
oguzhankoral 610c22dd02 Update innosetup workflow 2023-02-08 21:05:02 +03:00
Oğuzhan Koral a5496ab6a9 Feat (CI): Run CI step to create env variables for innosetup 2023-02-08 20:14:23 +03:00
oguzhankoral c29c8f009c Remove duplicated context: innosetup on yaml file 2023-02-02 10:34:34 +02:00
oguzhankoral fb7e9f2a6c Run CI step to create env variables for innosetup 2023-02-01 23:42:25 +02:00
Oğuzhan Koral 62c2bbb9fa Chore (Notification): Add error notification to GlobalToast 2023-01-23 15:34:03 +03:00
oguzhankoral 7656772194 Add error notification to GlobalToast 2023-01-23 15:31:13 +03:00
Oğuzhan Koral f22ff050e0 Fix (Stream, Attributes): Follow up fixes add stream by url and attributes 2023-01-23 12:35:22 +03:00
oguzhankoral 708f0b44fd Check face entity attributes settings before merging faces into mesh 2023-01-23 12:01:47 +03:00
oguzhankoral 2ee4581f17 Check stream role is null first before split 2023-01-23 12:00:13 +03:00
Oğuzhan Koral e337fb869f Feat (Settings) Advanced settings for entity specific attributes 2023-01-22 00:09:05 +03:00
oguzhankoral 4a8b0147e1 Create UI components for entity specific settings 2023-01-22 00:03:18 +03:00
oguzhankoral c95a1c7e1f Consider entity settings on speckle objects 2023-01-22 00:02:51 +03:00
oguzhankoral a07cd5c3f5 Extend model preferences with entity specific settings 2023-01-22 00:02:24 +03:00
Oğuzhan Koral 4d1473582e Feat (Stream): Add streams by URL or id 2023-01-21 17:33:35 +03:00
oguzhankoral 3bc9f4c452 Fix rubocop issue 2023-01-21 17:33:15 +03:00
oguzhankoral 11377038a0 Implement and make functional adding streams by url 2023-01-20 22:26:36 +03:00
Oğuzhan Koral 6053d3eac1 Fix (Attributes): Rescue from problematic dictionaries 2023-01-20 11:50:18 +03:00
oguzhankoral 529830f36b Rescue from problematic dictionaries 2023-01-20 11:47:34 +03:00
Oğuzhan Koral 505cf6265c Feat (Scene): Send and receive scenes 2023-01-19 20:09:19 +03:00
oguzhankoral 8cd9673eec Send scenes to speckle 2023-01-19 20:05:44 +03:00
oguzhankoral ac9cb28558 Receive named views as scene 2023-01-19 16:38:32 +03:00
Oğuzhan Koral 6eefe0698c Fix (Branch): Activate created branch 2023-01-19 12:17:58 +03:00
oguzhankoral d0113532b6 Activate created branch 2023-01-19 11:09:23 +03:00
Oğuzhan Koral 5a1d2ad5f4 Feat (Branch): Create branch button
Thanks Fabians for helps
2023-01-18 17:02:20 +03:00
oguzhankoral dfe02f4c74 Rename CreateBranchDialog 2023-01-18 16:58:05 +03:00
oguzhankoral 5349d556b9 Group dialogs to folder 2023-01-18 16:21:43 +03:00
oguzhankoral 7f7d8a501b Add notes about refresh 2023-01-18 15:58:43 +03:00
oguzhankoral cbee0e465b Remove unused combineFacesByMaterialHandler method 2023-01-18 15:44:20 +03:00
oguzhankoral faf00f0b0d Refetch stream on StreamCard whenever branch created 2023-01-18 15:42:33 +03:00
oguzhankoral fa97da5781 Track create stream and branch via mixpanel 2023-01-18 15:03:14 +03:00
oguzhankoral e7bab546db Remove loggings 2023-01-18 14:16:52 +03:00
oguzhankoral e2f4a30b5b Fix updating problem on created branch
- Thanks to Fabians
2023-01-18 11:53:50 +03:00
oguzhankoral ccff1df041 Add tooltip to create branch method 2023-01-18 11:53:11 +03:00
oguzhankoral 2037cfc25a Import and use CreateBranchDialog per stream card 2023-01-17 19:24:53 +03:00
oguzhankoral 268a091d8a Add dialog for branch creation 2023-01-17 19:23:44 +03:00
Oğuzhan Koral 6b52dfab3e Chore (Theming): Store light mode setting separately 2023-01-17 16:16:39 +03:00
oguzhankoral 839999851f Correct preference hash for theming 2023-01-17 16:12:21 +03:00
oguzhankoral a87470b7b5 Split Sketchup settings 2023-01-17 16:11:56 +03:00
Oğuzhan Koral e76aeb80fd Fix (attributes): Use from_face method to face consider attributes 2023-01-11 12:05:47 +03:00
oguzhankoral 28292e59e2 Use from_face method to consider attributes 2023-01-11 11:59:50 +03:00
Oğuzhan Koral 25dda481b2 Comment out vertex count log 2023-01-10 16:47:42 +03:00
Oğuzhan Koral bbda233fd8 Comment out vertex count log 2023-01-10 16:46:56 +03:00
Oğuzhan Koral 349218f0b5 Feat (Mesh): mesh improvements
Mesh grouping methods are improved with options:

Shared vertices (It is not supported by viewer currently, but when available it is ready to approach)
Separated vertices
2023-01-10 14:36:11 +03:00
oguzhankoral f18d00a69d Remove disable rubocop issues 2023-01-10 14:30:28 +03:00
oguzhankoral 25ea6504de Note about when viewer supports shared vertices 2023-01-10 11:33:56 +03:00
oguzhankoral 43081c70e2 Send vertices separately 2023-01-10 10:51:03 +03:00
oguzhankoral 0fde1c2026 Optimize meshes with dynamic vertex adding 2023-01-10 09:14:11 +03:00
Oğuzhan Koral b35383571e Merge pull request #126 from specklesystems/gergo/updateCiContext
use innosetup context in the windows build
2023-01-09 14:57:18 +03:00
Oğuzhan Koral 45a84847a2 Fix (block): Base point for block definition 2023-01-08 17:41:56 +03:00
oguzhankoral 70d92f26d6 Note for reason to having block definition base points 2023-01-08 17:40:57 +03:00
oguzhankoral 737ed86e69 Comparison method for point object 2023-01-08 15:15:17 +03:00
oguzhankoral 3865057b7a Fallback geometry for block definition 2023-01-08 14:50:47 +03:00
oguzhankoral 42a84dcd86 Receive blocks from rhino 2023-01-07 00:35:02 +03:00
Gergő Jedlicska e2d819c59d Merge branch 'main' of github.com:specklesystems/speckle-sketchup into gergo/updateCiContext 2023-01-06 14:30:16 +01:00
oguzhankoral bfee6a88dc Add base point for block definition 2023-01-06 16:28:32 +03:00
Oğuzhan Koral 68f3be17df Fix (UI): closing UI cause state loss 2023-01-06 16:25:52 +03:00
oguzhankoral 929c97ff5e Bring to front dialog if it is minimized when user reclicked UI button 2023-01-06 16:20:53 +03:00
oguzhankoral 4b66a2e4d0 Reset dialog if it's closed 2023-01-06 16:20:32 +03:00
Gergő Jedlicska 46e740154e use innosetup context in the windows build 2023-01-06 14:03:50 +01:00
Oğuzhan Koral 05e89f49da Feat (attributes): Send/receive entity attributes 2023-01-06 04:39:47 +03:00
oguzhankoral 358e9071e3 Disable nested groups for now 2023-01-06 04:36:43 +03:00
oguzhankoral e37b6a1cc0 Fix receive groups as group
Previously groups were receiving as component
2023-01-06 03:45:21 +03:00
oguzhankoral 266721973b Check block instance and definition's sketchup_attributes 2023-01-06 03:17:45 +03:00
oguzhankoral 7c27ac85cb Check having sketchup_attributes already in line and mesh before apply dicts 2023-01-06 02:36:06 +03:00
oguzhankoral 4b79732e38 Comment out UI dev mode 2023-01-06 01:51:45 +03:00
oguzhankoral 2ceeea5298 Send attributes according to model preference 2023-01-06 01:41:41 +03:00
oguzhankoral 3ec659a59b Write definition dictionaries on receive 2023-01-06 01:22:58 +03:00
oguzhankoral 4309056851 Return if dictionaries nil 2023-01-06 01:22:58 +03:00
oguzhankoral b768f20f7a Include entity attributes on send/receive 2023-01-06 01:22:58 +03:00
oguzhankoral b3a71bcf53 Stage sqlite3 2 2023-01-06 01:22:58 +03:00
oguzhankoral 50c199bc03 Stage sqlite3 2023-01-06 01:22:58 +03:00
Oğuzhan Koral d6302ac128 Feat (settings): Settings dialog implemented 2023-01-06 01:22:36 +03:00
oguzhankoral 6a5d9e1394 Fix rubocop issues 2023-01-05 22:56:53 +03:00
oguzhankoral ac5fc3e6ea Improve positioning for switches 2023-01-05 22:50:18 +03:00
oguzhankoral aa6cbceeb9 Consider strategies on send/receive 2023-01-05 22:29:56 +03:00
oguzhankoral 46a7395382 Sync speckle user_state with UI 2023-01-05 22:29:56 +03:00
oguzhankoral a782811dad Assign preferences to data of App 2023-01-05 22:29:56 +03:00
oguzhankoral d22039bc96 Get rid of storing theming on localStorage
It stores now on database and sync with it
2023-01-05 22:29:56 +03:00
oguzhankoral 15539c258e Update config.db when theme has changed 2023-01-05 22:29:56 +03:00
oguzhankoral f9ca4acf16 Add unit tests for sqlite3 2023-01-05 22:29:56 +03:00
oguzhankoral 66d2a9b7fe Update sqlite3 submodule reference hash 2023-01-05 22:29:56 +03:00
oguzhankoral 6dff8c3221 Create test.db file for unit tests 2023-01-05 22:29:56 +03:00
oguzhankoral f13c65e083 Update sqlite3_27.so with read/write database 2023-01-05 22:29:56 +03:00
oguzhankoral 56a7d5cb86 Move theme to settings 2023-01-05 22:29:56 +03:00
oguzhankoral c63c0675d5 Init settings dialog 2023-01-05 22:29:56 +03:00
oguzhankoral 22bc4b8c9e Log upload time 2023-01-05 22:29:56 +03:00
Gergő Jedlicska ead17b8906 Merge pull request #122 from specklesystems/gergo/updateCiContext
add CI context reference to deploy job
2023-01-05 18:21:52 +01:00
Gergő Jedlicska 1a211daac2 make sure dir 2023-01-05 17:58:52 +01:00
Gergő Jedlicska c7e502da4e remove gh bot context 2023-01-05 17:56:53 +01:00
Gergő Jedlicska 70df5e6cec how touching 2023-01-05 17:55:56 +01:00
Gergő Jedlicska 793f287c35 make sure to create the known hosts 2023-01-05 17:53:46 +01:00
Gergő Jedlicska 8e8b1c60b8 use ssh cloning 2023-01-05 17:51:58 +01:00
Gergő Jedlicska ba2cd51852 rename gh token env var 2023-01-05 17:05:53 +01:00
Gergő Jedlicska 3986a4ef60 add gh devbot context 2023-01-05 17:03:38 +01:00
Gergő Jedlicska c99d89fb11 add CI context reference to deploy job 2023-01-05 16:59:23 +01:00
Oğuzhan Koral 0a9c33de91 Fix (Material): Send back material as fallback for front 2023-01-03 22:01:13 +03:00
oguzhankoral 88c940fc53 Send back material as fallback for front 2023-01-03 21:59:58 +03:00
Oğuzhan Koral 88c861cbde Fix (group): Add missing subgroup conversions 2023-01-03 21:19:44 +03:00
oguzhankoral cd071ca144 Fix missing group conversions 2023-01-03 21:17:37 +03:00
Oğuzhan Koral 9970b8ec36 Feat (Component): Store always face camera option for definitions 2023-01-02 22:24:58 +03:00
oguzhankoral ffc564becd Store always face camera option for defitions 2023-01-02 22:22:01 +03:00
Oğuzhan Koral 6289fd5941 Fix (blocks): Remove bbox and base_point from block objects 2023-01-02 18:05:12 +03:00
oguzhankoral 7f44fe76c7 Remove bbox and base_point from block objects 2023-01-02 18:03:50 +03:00
Oğuzhan Koral ea86dc6785 Fix (edge): Check all definition entities has any orphan edge 2023-01-02 15:56:33 +03:00
oguzhankoral 754f9e1ed1 Check all definition entities has any orphan edge 2023-01-02 15:51:54 +03:00
Oğuzhan Koral 9a1a02e664 Fix (accounts): Disable streams when there are no account and show message 2022-12-21 11:31:18 +03:00
oguzhankoral 1e92195355 Disable streams when there are no account and show message 2022-12-21 11:24:11 +03:00
Oğuzhan Koral bb63c1c990 Chore (Dependency) Update speckle object loader to 2.11.4
Update speckle object loader to 2.11.4
2022-12-21 00:45:56 +03:00
oguzhankoral 5af494de76 Update speckle object loader to 2.11.4
Receiving on big models there was null reference error on loader, which is fixed by Dim and Gergö
2022-12-20 18:54:48 +03:00
Oğuzhan Koral 5bcac73a45 Fix: Check object is hash before checking have speckle_object 2022-12-15 09:16:43 +03:00
oguzhankoral 7a709e48d7 Check object is hash before checking have speckle_object 2022-12-15 09:06:56 +03:00
Oğuzhan Koral d2d9fe010e Comment out console logging
Comment out console logging
2022-12-14 16:11:02 +03:00
oguzhankoral 4b6b129934 Comment out console logging 2022-12-14 16:10:03 +03:00
Oğuzhan Koral 7645146d77 Feat (DisplayValue): Support display value as base object
Support display value as base object
2022-12-14 16:07:09 +03:00
oguzhankoral 9b8cca38ae Support display value as base object 2022-12-14 16:04:23 +03:00
Oğuzhan Koral e872fda3f2 Feat (Group): Send meshes separately under the group
Feat (Group): Send meshes separately under the group
2022-12-13 14:01:49 +03:00
oguzhankoral 6ccb03c557 Improve clean up with scoped faces 2022-12-13 11:55:22 +03:00
oguzhankoral b8237b1be7 Send meshes separately under the group 2022-12-13 10:32:59 +03:00
Oğuzhan Koral 68e19cf8e4 Fix (type): Do not convert if entity type does not match with supported types
Fix (type): Do not convert if entity type does not match with supported types
2022-12-12 17:52:18 +03:00
oguzhankoral 91fba729b8 Return nothing if type does not match 2022-12-12 17:50:43 +03:00
Oğuzhan Koral 0af0e09b6e Fix (typo): Typo on keyword parameter values
Fix (typo): Typo on keyword parameter values
2022-12-12 17:38:04 +03:00
oguzhankoral 1276d56627 Fix typo 2022-12-12 17:37:00 +03:00
Oğuzhan Koral bd2773f9c1 Move base objects and their traversing process to Ruby
Move base objects and their traversing process to Ruby
2022-12-12 16:50:29 +03:00
oguzhankoral b8b1b8ef36 Fix rubocop issues and add documentation 2022-12-12 14:34:11 +03:00
oguzhankoral 0f98d72e30 Remove transport tests 2022-12-12 14:08:17 +03:00
oguzhankoral 44ec7734d4 Mark BaseObjectSerializer as deprecated in js 2022-12-12 13:52:57 +03:00
oguzhankoral c5adb063ca Add traversing benchmark for js 2022-12-12 13:18:42 +03:00
oguzhankoral 83ef8f9789 Benchmark for traversing 2022-12-12 13:03:55 +03:00
oguzhankoral b8a803a641 Replace ruby batches with javascript batches 2022-12-12 12:59:19 +03:00
oguzhankoral 31c0effebe Add inline documentation for serialization.js 2022-12-12 12:59:01 +03:00
oguzhankoral e90c4b3eb5 Traverse and serialize base object with send info 2022-12-12 12:57:07 +03:00
oguzhankoral ae6efcc27d Add sketchup unit value to sketchup state 2022-12-12 12:51:45 +03:00
oguzhankoral 7922ac127b Format callback message according to being string or not 2022-12-12 12:50:53 +03:00
oguzhankoral 559f0443af Inherit from Base for all Speckle objects 2022-12-12 12:43:25 +03:00
oguzhankoral 4e3faf1573 Port base object serializer to ruby from js 2022-12-12 12:42:30 +03:00
oguzhankoral e3039bd2d8 Add many to one relation immutable class 2022-12-08 17:49:24 +03:00
oguzhankoral e668cba839 Add immutable_ruby exterior library 2022-12-08 12:42:46 +03:00
oguzhankoral fcc47c0b7f Add dictionary handlers 2022-12-07 15:30:09 +03:00
oguzhankoral 2f189bc2ff Inherit from Base object for geometric speckle objects 2022-12-07 11:34:13 +03:00
oguzhankoral ee9d134f0e Line inherits from Base 2022-12-07 11:34:13 +03:00
oguzhankoral c1fad7cc02 Add test send batch for single line 2022-12-07 11:34:09 +03:00
Oğuzhan Koral 3a48b4ee4f Feat (Stream): Create stream by UI
Feat (Stream): Create stream by UI
2022-12-07 10:26:02 +03:00
oguzhankoral ec626f9741 Refresh streams after creation 2022-12-07 09:27:03 +03:00
oguzhankoral 90906cdc0e Disable Add a Stream by ID or URL dialog 2022-12-07 09:13:18 +03:00
oguzhankoral a694527645 Create stream on active account 2022-12-06 19:58:15 +03:00
oguzhankoral bd68b20d31 Add initial create stream component 2022-12-06 12:05:05 +03:00
Oğuzhan Koral 080d976400 Fix (Groups): Enable nested group send/receive
Fix (Groups): Enable nested group send/receive
2022-12-05 15:56:26 +03:00
oguzhankoral e200a8525b Enable nested group send/receive 2022-12-05 15:52:57 +03:00
Oğuzhan Koral 5bdf7abc2b Fix (Block): Fix missing references and typos
Fix (Block): Fix missing references and typos
2022-12-02 18:46:25 +03:00
oguzhankoral 9faa1d2e1e Fix typos 2022-12-02 18:41:20 +03:00
Oğuzhan Koral f586353cdb Feat (Layers): Support layers
Feat (Layers): Layers are available by Sketchup connector
2022-12-01 19:53:28 +03:00
oguzhankoral 2c9f2ee5cf Fix rubocop issues 2022-12-01 19:49:09 +03:00
oguzhankoral d8bd45bf54 Document layer implementations 2022-12-01 19:04:40 +03:00
oguzhankoral 9341e0b500 Remove commit layer folder 2022-12-01 18:08:09 +03:00
oguzhankoral eebf303f3e Introduce dynamic base object 2022-12-01 14:52:40 +03:00
oguzhankoral df487d5488 Pass layer information to native converter to place them into correct layers 2022-12-01 14:52:11 +03:00
oguzhankoral 7b66da5823 Pass stream and branch information to ruby
- This is needed when we create layers
2022-12-01 14:51:22 +03:00
oguzhankoral 3a929c2a03 Change target sketchup version with 2021 for rubocop 2022-12-01 14:50:04 +03:00
oguzhankoral a8ac3c4771 Send objects with layers to server 2022-11-30 23:58:23 +03:00
oguzhankoral 8d223786b9 Pass base object from ruby instead javascript 2022-11-30 23:57:55 +03:00
oguzhankoral 068c6a6ea0 Disable stripping @ for detaching 2022-11-30 23:57:34 +03:00
oguzhankoral 0db677121a Pass base object to BaseObjectSerializer prepared by ruby 2022-11-30 23:57:09 +03:00
Oğuzhan Koral 7591170bca Fix (Mesh): Do not merge SKP meshes
Fix (Mesh): Do not merge SKP meshes
2022-11-28 11:00:59 +03:00
oguzhankoral 7272541826 Check upcoming mesh comes from SKP or not 2022-11-28 10:53:32 +03:00
oguzhankoral 2460912532 Feat(Attributes): Store face soften property
This information will help us to create same geometry that sent.
2022-11-28 08:50:24 +03:00
oguzhankoral c1e4c22e3f Fix typo 2022-11-28 08:47:22 +03:00
oguzhankoral 17bd17fa3c Get/set correct face smooth properties from/to mesh 2022-11-25 21:40:39 +03:00
oguzhankoral 05da3ccb66 Add sketchup_attributes to speckle objects 2022-11-25 21:33:04 +03:00
oguzhankoral 578044884c Convert cleanup with static methods 2022-11-25 21:32:31 +03:00
oguzhankoral 226148d04f Chore(Readme): Update README with Repo Structure and contribution guidelines
Chore(Readme): Update README with Repo Structure and contribution guidelines
2022-11-25 11:54:39 +03:00
oguzhankoral c44c7516ff Update README with Repo Structure and contribution guidelines 2022-11-25 11:50:44 +03:00
oguzhankoral c3c0749222 Chore (sqlite3): Add sqlite3 project as submodule
Chore (sqlite3): Add sqlite3 project as submodule
2022-11-24 12:06:54 +03:00
oguzhankoral b7e63b0e54 Add sketchup-sqlite3 repo as submodule 2022-11-24 11:31:55 +03:00
oguzhankoral 60cd2cb0f9 Remove ported sqlite3 compiler from sketchup repo 2022-11-24 11:29:46 +03:00
oguzhankoral e6dd630caf Feat (sqlite3): compile sqlite3 from c as sketchup compatible
Feat (sqlite3): compile sqlite3 from c as sketchup compatible
2022-11-24 03:14:34 +03:00
oguzhankoral cad14b318a Use native sqlite3 module for queries 2022-11-24 03:04:34 +03:00
oguzhankoral 4df1cc17bf Add switch for operating system 2022-11-24 03:04:09 +03:00
oguzhankoral 884bb331b3 Add compiled sqlite3_27.so file for windows 2022-11-24 03:03:29 +03:00
oguzhankoral ff4a83af47 Add ruby version number constant 2022-11-24 03:02:58 +03:00
oguzhankoral f6f323b307 Remove externally compiled files, was workaround 2022-11-24 03:02:24 +03:00
oguzhankoral 330280d611 Implement conversion methods from C/C++ to Ruby for our connector 2022-11-24 03:01:30 +03:00
oguzhankoral 809432cbbd Feat (Converters): refactor and document converters
ToSpeckle and ToNative modules are refactored with classes that parallels to objects in the Speckle.

 Length
 Point
 Vector
 Plane
 BoundingBox
 Plane
 Mesh
 Transform
 RenderMaterial
 BlockDefinition
 BlockInstance
 Interval
2022-11-23 16:37:12 +03:00
oguzhankoral d64fee1d15 Refactor ToNative methods 2022-11-23 16:31:19 +03:00
oguzhankoral 3d01e15710 Pass data to reload_accounts action 2022-11-23 13:10:47 +03:00
oguzhankoral c2d7a5aca8 Extract block definition and block instance to related objects 2022-11-22 12:28:08 +03:00
oguzhankoral 2e8a040210 Implement speckle Mesh and RenderMaterial objects 2022-11-22 10:55:16 +03:00
oguzhankoral 50886147ae Use typescript objects as parent for speckle objects 2022-11-22 10:13:28 +03:00
oguzhankoral c0f2885de6 Introduce Speckle Geometry objects for conversion 2022-11-22 01:58:23 +03:00
oguzhankoral e80574ecd7 Add accounts to speckle state 2022-11-21 18:08:36 +03:00
oguzhankoral 7cdcf9e86f Get rid of from Sketchup.active_model and duplications 2022-11-21 17:52:05 +03:00
oguzhankoral 304720fc8e Add sketchup state to application state
- This will help to reach sketchup model instead of calling Sketchup.active_model everytime
2022-11-21 16:19:49 +03:00
oguzhankoral 88adfb1446 Fix(circle-ci): Rename html with vue_ui for built files
Fix(circle-ci): Rename html with vue_ui for built files
2022-11-20 15:02:05 +03:00
oguzhankoral f8719d0912 Rename html with vue_ui for built files 2022-11-20 15:01:23 +03:00
oguzhankoral c6d36fccd9 Fix: Save/Load streams locally
Fix: Save/Load streams locally
2022-11-17 16:24:00 +03:00
oguzhankoral 13d061f7e9 Remove unnessary calls 2022-11-17 16:19:58 +03:00
oguzhankoral ba11c5beb2 Fix: Disable one click send
Fix: Disable one click send
2022-11-17 09:32:45 +03:00
oguzhankoral c1800d9a02 Disable one click send 2022-11-17 09:30:13 +03:00
oguzhankoral 868859ac83 Feat(tools): add compiler project for sqlite3 and sqlite3 ruby files
* Ignore also old (html) ui built folder

* Ignore sqlite3 ext library ide settings

* Initialize sqlite3 project for .so and .bundle files

* Enable _MSC_VER check on 2.7

* Initialize ruby cpp transition file

* Communicate first time with sqlite3 c base code in Sketchup

* Update compiler project with sqlite3 cpp files

* Add sqlite3 ruby source files to ext libraries

* Update gitignore with Release and Debug folders of sqlite3 compiler

* Exclude rubocops for ext libraries

* Exclude rubocops for _sqlite3 compiler

* Fix rubocop issues
2022-11-16 14:18:28 +03:00
oguzhankoral d91114b340 Refactor: Implement all commands to new design
* Add command for receive_objects

* Fix path on sqlite3 gem

* Add commands

- init_local_accounts
- queue_send
- send_from_queue
- save_stream
- remove_stream
- reload_accounts
- load_saved_streams

* Disable other toolbar commands unless speckle initialized

* Introduce one click send
2022-11-11 21:54:23 +03:00
oguzhankoral 0dc4d46fa3 Refactor: Implement new plugin design
* Move icons to img folder

* Rename built folder name from html to vue_ui

* Rename main to bootstrap

* Remove unnecessary module for SpeckleSystems

* Replace dialog with App-View-Command design

* Fix rubocop issues

- disable to_native and to_speckle for now, they will be handled in different PR
2022-11-08 21:18:16 +03:00
oguzhankoral 0442aaaa7f CI: Add rubocop and rubycritic to CI and Rakefile to test locally
Oguzhan/setup code quality and ci
2022-11-07 10:33:59 +03:00
oguzhankoral 2c8b120de1 CI: Add rubocop and rubycritic to CI and Rakefile to test locally
Configure Gemfile.lock

Update README details about load/reload file(s)

Update version for only 2.7

Add linux and unknown platforms to Gemfile.lock

Add default task

Remove unnecssary dependencies from Rakefile

Assign default name to first task

Remove superseded cops

Update ruby version in workflow

Remove solorgraph and update it's dependencies

Update rubyversion

Exclude vendor bundle from rubocop

Autocorrected rubocop fixes

Extend SU related rubocop settings

Implement ruby critic for rake

Add documentation for code quality
2022-11-07 10:22:58 +03:00
oguzhankoral fc50ef68b4 Merge pull request #64 from specklesystems/oguzhan/setup-environment
Feat(tools): add tools to increase efficiency on dev mode
2022-11-01 21:03:42 +03:00
oguzhankoral 92613a37cd Feat(tools): add tools to increase efficiency on dev mode
Setup _tools for developer environment

Remove unnecassary lines on loader
2022-11-01 20:55:18 +03:00
Matteo Cominetti 77843fe697 ci: removes old deploy step 2022-10-28 09:22:39 +01:00
izzy lyseggen 9aea5ddc97 fix(metrics): remove suuid as it is no longer used (#60) 2022-09-07 10:08:29 +01:00
izzy lyseggen 4d1333c302 ci: add deploy for manager 2 (#59) 2022-08-25 16:20:28 +01:00
oguzhankoral 9ca55f6f0e Merge coplanar faces (#58)
* Update gitignore for RubyMine IDE

* Update gemfiles

- Include skippy, pry, rubycritic

* Add speckle_connector loader

This helps to navigate files that read by SU according to packaged version or development version

* Update gemfile and .lock files

* Merge coplanar faces by erasing edges between

* Cite about the idea behind merging coplanar faces

* Document remove_edge_have_coplanar_faces with control steps

* Improve loader file with the idea of release version

- This is another issue that need to be navigated

* Remove speckle_connector_loader
2022-08-18 14:42:16 +01:00
izzy lyseggen 4698799b43 ci: fix patch version script 2022-06-21 13:10:31 +01:00
izzy lyseggen 5d4e6ac89a ci: use semver tag for patching 2022-06-21 13:02:23 +01:00
izzy lyseggen b1c09c62d9 feat(converter): mesh enhancements (#50)
* feat(converter): smooth & preserve raw mesh

also only create components for `displayValue` geometry

wip - to try another edge strategy as this has caused quite a perf hit

* fix(converter): don't preserve edges for now

it is way too slow in the current implementation.
i think we can make it work in sketchup 2022 with the entities building,
but as of rn it seems like a no go for 2021
2022-06-21 12:58:59 +01:00
izzy lyseggen 2b7b74dbdd chore(ui): test removing core j (#48) 2022-06-20 16:28:07 +01:00
izzy lyseggen 42f3ae8490 ci: update tag parsing and ui build (#47)
* ci: update tag parsing and ui build

* chore(deps): stackoverflow and i are besties

testing out this workaround - will do a beta release

* ci: deploy filter tags

* ci: fix release label tag
2022-06-10 14:51:16 +01:00
izzy lyseggen 479cd9584a fix(ci): build on node 16 (#46)
* chore(ui): revert package lock

* chore(ui): upgrade object loader again (???)

* ci: omg i'm so dumb (node 16)
2022-06-10 09:40:30 +01:00
izzy lyseggen ec250fe6a5 fix(ui): revert package upgrades (regeneratorRuntime err) (#45)
* chore: del some old files

* chore(ui): revert to old packages

* chore(ui): updgrade speckle object loader
2022-06-10 07:24:52 +01:00
izzy lyseggen 7d73ebf7d0 feat(converter): edges and preserved faces on to_speckle (#44)
* chore: update packages

* chore: add debug 2022 vscode task

* feat(converter): ngons and edges on `to_speckle`

* feat(converter): big improvements 🥳

* feat(convert): add triangulation for faces with holes

you'll lose the true face with hole on receive, but this is the best
intermediary solution that won't break other connectors
2022-06-09 17:05:09 +01:00
izzy lyseggen a965065e62 style: formattinggggg (#39) 2022-03-29 15:49:22 +01:00
izzy lyseggen c9c9ecf5c6 chore(metrics): update oneclick reporting (#38) 2022-03-22 11:32:35 +00:00
izzy lyseggen 9b5c043029 feat(ui): saved streams & 1-click send (#37)
* feat(ui): saved streams and wip 1 click

* style(connector): remove some puts statements

* feat(accounts): default acct helper

* feat(ui): more 1 click send

need a way to wait for connector launch...

* fix(ui): waiting quick send!

* feat(ui): view in web from toast notif

note to self: the one in frontend is kinda ugly 😓 
went with outine btn for now bc it was better than that big ol dark gray btn

* fix: turn off dev

i always fkn do this i needa just use an env file gdi

* feat(ui): notify ui of oneclick send

* feat(metrics): remove old and use the new!
2022-03-08 10:15:21 +00:00
izzy lyseggen 0eb835bed0 fix(convert): add "cm" to unit strings and skip revit params (#34)
* feat(convert): skip revit params

cant do anything w them so skipping for now for efficiency

* fix(convert): add "cm" to unit strings
2022-02-23 10:11:48 +00:00
Dimitrie Stefanescu 7a7ce8ff3d feat(ui): css-ing around + notifications on actions (#33) 2022-02-14 21:05:03 +00:00
izzy lyseggen 473f0890fe fix(accounts): manually grab user dir (#30)
issue with i assume company managed computers where the "current user"
is pointing to somewhere else (maybe the admin who installed sketchup?)

to solve, I'm manually grabbing the user dir from the pwd

closes Auth error and no streams found #27
2022-01-19 12:01:23 +00:00
izzy lyseggen a8955a435f chore(deps): objectloader 2.3.0 and update others (#29)
closes 📨 Receiving fails if objects have nulls #28
2022-01-13 07:21:33 -08:00
izzylys 80f25eb1a2 fix(batching): simplify slightly
also fix a transition vs transition-group warning
2022-01-12 12:26:37 -08:00
izzylys 5716f92fbf fix(accts): sqlite gem loading 2022-01-06 09:13:45 -08:00
izzylys 63e7aaa661 feat(ui): send progress 2022-01-05 12:15:56 -08:00
izzylys 7234a4be79 feat(auth): log some info to see what's goin on 2022-01-05 12:15:31 -08:00
izzylys e1cceb9bba chore: readme typo and some clenaup 2022-01-05 07:09:53 -08:00
izzy lyseggen 30157b5ac2 feat(ui): animations were TOO FAST 4 ALA 🏃‍♀️ 2021-12-08 15:49:50 +00:00
izzy lyseggen f9b1628c18 Merge pull request #26 from specklesystems/izzy/ui-tweaks
feat(ui): cute lil animations 4 smooth commitmsgs
2021-12-08 15:33:21 +00:00
izzy lyseggen 9429a11fa7 feat(ui): cute lil animations 4 smooth commitmsgs 2021-12-08 15:31:53 +00:00
izzy lyseggen af4c6d9f71 Merge pull request #24 from specklesystems/izzy/nested-def-fix
fix(convert): `to_native` nested block fix
2021-12-03 18:04:22 +00:00
izzy lyseggen a4f23e060c fix(convert): to_native nested block fix
block definitions nested within definitions that also contain meshes
alongside those definitions were not getting picked up

fixes #23
2021-12-03 18:00:53 +00:00
izzy lyseggen d2099c98e0 Merge pull request #22 from specklesystems/izzy/ui
feat(ui): add commit messages
2021-12-03 11:40:01 +00:00
izzy lyseggen c21b51135a feat(ui): add commit messages
closes UI Improvements #4
2021-12-03 11:39:18 +00:00
izzy lyseggen c5c8bf6b6f Merge pull request #21 from specklesystems/izzy/transforms-rework
feat(converter): new transform style
2021-12-02 17:30:32 +00:00
izzy lyseggen d9a92e90ec feat(convert): receive both old and new transform blocsk 2021-12-02 17:28:38 +00:00
izzy lyseggen 79ae201646 feat(convert): new transform to speckle 2021-12-01 17:58:39 +00:00
izzy lyseggen 01b32d2558 Merge pull request #19 from specklesystems/izzy/platform-fix
fix(connector): speckle dir on macos
2021-11-24 11:34:54 +00:00
izzy lyseggen b3067aa346 fix(connector): speckle dir on macos
thanks @ruggieroguida !
addresses #18
2021-11-23 16:13:03 +00:00
izzy lyseggen d1349c5df1 Merge pull request #16 from specklesystems/izzy/kill-insertion-pt
feat(converter): depreciate insertion point
2021-11-17 15:30:03 +00:00
izzy lyseggen d44365a6d4 feat(converter): depreciate insertion point 2021-11-17 15:29:16 +00:00
izzy lyseggen c8c94184df Merge pull request #15 from specklesystems/izzy/blocks
fix(converter): receiving blocks
2021-11-16 15:57:51 +00:00
izzy lyseggen 62c436131c fix(converter): receiving blocks
WE OUT HERE BOIIIII
📦 Block Receive Failing #10
2021-11-16 15:52:52 +00:00
izzy lyseggen ac3579de46 Merge pull request #14 from specklesystems/izzy/blocks
fix(converter): revert mesh squish & fix closed polylines
2021-11-16 10:55:01 +00:00
izzy lyseggen e7a72b25d7 fix(converter): revert mesh squish 2021-11-16 10:54:00 +00:00
izzy lyseggen 6d155d987a fix(converter): only return component def if exists 2021-11-15 17:30:47 +00:00
izzy lyseggen e4a78e4c6e feat(converter): add explicit brep to native mesh 2021-11-15 17:30:27 +00:00
izzy lyseggen 35c819dab0 fix(convert): closed polylines 2021-11-15 16:55:50 +00:00
izzy lyseggen 3001a4af48 Merge pull request #13 from specklesystems/izzy/mesh-experiments
feat(converter): improved meshes!
2021-11-15 14:59:39 +00:00
izzy lyseggen eeaa69e7b4 feat(convert): mesh to native polycount cleanup 2021-11-15 14:58:51 +00:00
izzy lyseggen 5717022293 chore: pls leave me alone rubocop 2021-11-15 14:51:18 +00:00
izzy lyseggen b5c1ad1ea3 feat(convert): additional mesh improvements 2021-11-12 11:34:39 +00:00
izzy lyseggen ea56717594 fix(convert): simple line fixes 2021-11-12 11:33:58 +00:00
izzy lyseggen 2ffb4219fc feat(convert): initial mesh squish fix
🍙 Remove duplicate vertices when building meshes `to_speckle` #12
2021-11-11 17:48:56 +00:00
izzy lyseggen 08843689ec feat(ui): move read receipt to end of receive method 2021-11-10 16:22:33 +00:00
izzy lyseggen 299109505c feat(ui): Sketchup: Add Read receipts call #7 2021-11-10 16:06:54 +00:00
izzy lyseggen 520dccc674 fix(convert): traverse all base props
not just dynamically detached ones
2021-11-09 18:19:43 +00:00
392 changed files with 53961 additions and 8125 deletions
Vendored
BIN
View File
Binary file not shown.
+9 -117
View File
@@ -1,125 +1,17 @@
version: 2.1
orbs:
# Using windows for builds
win: circleci/windows@2.4.0
# Upload artifacts to s3
aws-s3: circleci/aws-s3@2.0.0
# Define the jobs we want to run for this project
jobs:
build-ui:
build:
docker:
- image: 'circleci/node:14'
- image: cimg/base:2023.03
steps:
- checkout
- run:
command: 'rm package-lock.json'
working_directory: 'ui'
- run:
command: 'npm install'
working_directory: 'ui'
- run:
command: 'npm run build'
working_directory: 'ui'
- persist_to_workspace:
root: ./
paths:
- speckle_connector/html
build-connector: # Reusable job for basic connectors
executor:
name: win/default # comes with python 3.7.3
shell: cmd.exe
parameters:
slug:
type: string
default: ""
steps:
- checkout
- attach_workspace:
at: ./
- run:
name: Patch
shell: powershell.exe
command:
| # If no tag, use 0.0.0.1 and don't make any YML (for testing only!)
$tag = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "0.0.1" } else { $env:CIRCLE_TAG }
$semver = $tag.replace("-beta","")
$version = "$($semver).$($env:CIRCLE_BUILD_NUM)"
$channel = "latest"
if($tag -like "*-beta") { $channel = "beta" }
# only create the yml if we have a tag
New-Item -Force "speckle-sharp-ci-tools/Installers/sketchup/$channel.yml" -ItemType File -Value "version: $version"
echo $version
python patch_version.py $version
speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\sketchup.iss
- persist_to_workspace:
root: ./
paths:
- speckle-sharp-ci-tools/Installers
get-ci-tools: # Clones our ci tools and persists them to the workspace
docker:
- image: cimg/base:2021.01
steps:
- run:
name: Clone
command: git clone https://$GITHUB_TOKEN@github.com/specklesystems/speckle-sharp-ci-tools.git speckle-sharp-ci-tools
- persist_to_workspace:
root: ./
paths:
- speckle-sharp-ci-tools
- persist_to_workspace:
root: ./
paths:
- speckle-sharp-ci-tools
deploy: # Uploads all installers found to S3
docker:
- image: cimg/base:2021.01
steps:
- attach_workspace:
at: ./
- run:
name: List contents
command: ls -R speckle-sharp-ci-tools/Installers
- aws-s3/copy:
arguments: "--recursive --endpoint=https://$SPACES_REGION.digitaloceanspaces.com --acl public-read"
aws-access-key-id: SPACES_KEY
aws-region: SPACES_REGION
aws-secret-access-key: SPACES_SECRET
from: '"speckle-sharp-ci-tools/Installers/"'
to: s3://speckle-releases/installers/
- run: echo "so long and thanks for all the fish"
# Orchestrate our job run sequence
workflows:
build-and-deploy:
build_and_test:
when:
false
jobs:
- get-ci-tools:
filters:
tags:
only: /.*/
- build-ui:
filters:
tags:
only: /.*/
- build-connector:
slug: sketchup
requires:
- get-ci-tools
- build-ui
filters:
tags:
only: /.*/
- deploy:
requires:
- get-ci-tools
- build-ui
- build-connector
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/ # For testing only! /ci\/.*/
- build
+64
View File
@@ -0,0 +1,64 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Build
on:
pull_request:
workflow_call:
outputs:
semver:
description: "The full SemVer 2.0 version of this build, e.g. '3.0.0-alpha.1234' (note: no 'v'-prefix)"
value: ${{ jobs.build.outputs.semver }}
file_version:
description: "The file info version, e.g. '3.0.0.1234'"
value: ${{ jobs.build.outputs.file_version }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
semver: ${{ steps.set-version.outputs.semver }}
file_version: ${{ steps.set-version.outputs.file-version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- id: set-version
name: Set version to output
shell: bash
run: |
TAG=${{ github.ref_name }}
if [[ "${{ github.ref }}" != refs/tags/* ]]; then
TAG="v3.0.99.${{ github.run_number }}"
fi
SEMVER="${TAG#v}"
FILE_VERSION=$(echo "$TAG" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
FILE_VERSION="$FILE_VERSION.${{ github.run_number }}"
echo "semver=$SEMVER" >> "$GITHUB_OUTPUT"
echo "file-version=$FILE_VERSION" >> "$GITHUB_OUTPUT"
echo $SEMVER
echo $FILE_VERSION
- name: Set connector version
run: |
python patch_version.py ${{steps.set-version.outputs.semver}}
- uses: montudor/action-zip@v1
with:
args: zip -q -r sketchup.zip vendor speckle_connector_3/ speckle_connector_3.rb
- name: ⬆️ Upload artifacts
uses: actions/upload-artifact@v4
with:
name: output-${{steps.set-version.outputs.semver}}
path: sketchup.zip
retention-days: 1
if-no-files-found: error
compression-level: 0 # no compression
+42
View File
@@ -0,0 +1,42 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Build and deploy
on:
push:
branches: ["main", "installer-test/**"]
tags: ["v3.*.*"] # Manual delivery on every 3.x tag
jobs:
build:
uses: ./.github/workflows/build.yml
deploy-installers:
runs-on: ubuntu-latest
needs: build
env:
IS_PUBLIC_RELEASE: ${{ github.ref_type == 'tag' }}
steps:
- name: 🔫 Trigger Build Installer(s)
uses: the-actions-org/workflow-dispatch@v4.0.0
with:
workflow: Build Installers
repo: specklesystems/connector-installers
token: ${{ secrets.CONNECTORS_GH_TOKEN }}
inputs: '{
"run_id": "${{ github.run_id }}",
"semver": "${{ needs.build.outputs.semver }}",
"file_version": "${{ needs.build.outputs.file_version }}",
"repo": "${{ github.repository }}",
"is_public_release": ${{ env.IS_PUBLIC_RELEASE }}
}'
ref: main
wait-for-completion: true
wait-for-completion-interval: 10s
wait-for-completion-timeout: 10m
display-workflow-run-url: true
display-workflow-run-url-interval: 10s
- uses: geekyeggo/delete-artifact@v5
with:
name: output-*
+20 -2
View File
@@ -10,8 +10,23 @@
settings.json
# vue app build dist folder
speckle_connector/html
speckle_connector_3/vue_ui
speckle_connector_3/html
# speckle-sharp-ci-tools
/speckle-sharp-ci-tools
# _sqlite3
/_sqlite3/.vs
/_sqlite3/Release (2.7)
/_sqlite3/Release (2.5)
/_sqlite3/Release (2.2)
/_sqlite3/Release (2.0)
/_sqlite3/Debug (2.7)
/_sqlite3/Debug (2.5)
/_sqlite3/Debug (2.2)
/_sqlite3/Debug (2.0)
*.gem
*.rbc
/.config
@@ -24,6 +39,9 @@ speckle_connector/html
/test/version_tmp/
/tmp/
# IDE
.idea
# Used by dotenv library to load environment variables.
.env
+3
View File
@@ -0,0 +1,3 @@
[submodule "_sqlite3"]
path = _sqlite3
url = git@github.com:specklesystems/sketchup-sqlite3.git
+109 -23
View File
@@ -1,46 +1,132 @@
require:
- rubocop-sketchup
- rubocop-minitest
- rubocop-rake
AllCops:
TargetRubyVersion: 2.7
EnabledByDefault: true
AutoCorrect: true
TargetRubyVersion: 2.5
DisabledByDefault: false
NewCops: enable
DisplayCopNames: true
ExtraDetails: true
SuggestExtensions: false
Exclude:
- '_tools/jf_RubyPanel.rb'
- '_tools/jf_RubyPanel/**/*.rb'
- '_tools/su_attributes.rb'
- '_tools/su_attributes/**/*.rb'
- '_tools/su_attributes/**/*.rb'
- '_sqlite3/**/*.rb'
- 'ui/**/*'
- 'speckle_connector_3/src/ext/**/*.rb'
- 'vendor/bundle/**/*'
- 'tests/**/*.rb'
SketchUp:
SourcePath: .
TargetSketchUpVersion: 2021
Exclude: # Exclude common folders.
- 'tests/**/*'
- 'benchmarks/**/*'
- '_tools/**/*'
- 'Rakefile'
Style/StringLiterals:
Layout:
Enabled: true
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
Layout/IndentationStyle:
EnforcedStyle: spaces
IndentationWidth: 2
# If DisabledByDefault is set to true then we need to enable the SketchUp
# related departments:
SketchupDeprecations:
Enabled: true
EnforcedStyle: double_quotes
Layout/LineLength:
Max: 120
SketchupPerformance:
Enabled: true
Lint/ConstantResolution:
SketchupRequirements:
Enabled: true
SketchupSuggestions:
Enabled: true
SketchupBugs:
Enabled: true
SketchupRequirements/FileStructure:
Enabled: false
Style/Copyright:
Enabled: false
Style/DocumentationMethod:
SketchupSuggestions/ModelEntities:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/ClassLength:
Enabled: false
Max: 30
Metrics/ModuleLength:
Enabled: false
Metrics/BlockLength:
# Exclude spec tests
Exclude:
- "**/*_spec.rb"
Metrics/MethodLength:
Max: 20
Metrics/ClassLength:
Max: 200
Layout/EndOfLine:
Enabled: false
EnforcedStyle: lf
Minitest/MultipleAssertions:
Max: 5
Naming/MethodParameterName:
AllowedNames: [x, y, z, id]
Naming/VariableNumber:
EnforcedStyle: snake_case
# SketchUp 2017 uses Ruby 2.2 where safe navigation is not available
Style/SafeNavigation:
Enabled: false
Metrics/ParameterLists:
Style/AndOr:
Enabled: false
Metrics/CyclomaticComplexity:
Style/Documentation:
Exclude:
- "*tests/**/*_spec.rb"
- "*tests/**/*_test.rb"
Style/Not:
Enabled: false
Metrics/PerceivedComplexity:
Style/NumericLiterals:
Enabled: false
Style/NumericPredicate:
EnforcedStyle: comparison
Style/Proc:
Enabled: false
Style/RedundantReturn:
Enabled: false
# SketchUp 2017 uses Ruby 2.2 where safe navigation is not available
Style/SlicingWithRange:
Enabled: false
# SketchUp 2017 uses Ruby 2.2 where transform_values is not available
Style/HashTransformValues:
Enabled: false
# SketchUp 2017 uses Ruby 2.2 where transform_keys is not available
Style/HashTransformKeys:
Enabled: false
# SketchUp 2017 uses Ruby 2.2 where block needs to be wrapped in begin/end if ensure can be used
Style/RedundantBegin:
Enabled: false
+1 -1
View File
@@ -1,6 +1,6 @@
require_paths:
- "C:/Program Files/SketchUp/SketchUp 2021/Tools"
- speckle_connector
- speckle_connector_3
require:
- sketchup-api-stubs
+10 -1
View File
@@ -12,6 +12,15 @@
"command": "&'C:/Program Files/SketchUp/SketchUp 2021/SketchUp.exe' -rdebug 'ide port=7000'",
},
"problemMatcher": []
}
},
{
"label": "Debug SketchUp 2022",
"type": "shell",
"command": "open -a '/Applications/SketchUp 2022/SketchUp.app' --args -rdebug 'ide port=7000'",
"windows": {
"command": "&'C:/Program Files/SketchUp/SketchUp 2022/SketchUp.exe' -rdebug 'ide port=7000'",
},
"problemMatcher": []
},
]
}
+26 -11
View File
@@ -1,16 +1,31 @@
# frozen_string_literal: true
source "https://rubygems.org"
# gem "rake", "~> 13.0"
gem "rubocop", "~> 1.7"
source 'https://rubygems.org'
group :development do
gem "minitest"
gem "sketchup-api-stubs"
gem "solargraph"
# mini tests for ruby classes
gem 'minitest'
# Git hooks manager
gem 'overcommit', require: false
# Pry is a runtime developer console and IRB alternative with powerful introspection capabilities.
# Pry aims to be more than an IRB replacement. It is an attempt to bring REPL driven programming to the Ruby language.
gem 'pry'
# Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
gem 'rake'
# RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter.
gem 'rubocop'
# A RuboCop extension focused on enforcing Minitest best practices and coding conventions.
gem 'rubocop-minitest'
# A RuboCop plugin for Rake.
gem 'rubocop-rake'
# Code analysis for SketchUp extensions using the SketchUp Ruby API.
gem 'rubocop-sketchup'
# wraps around static analysis gems such as Reek, Flay and Flog to provide a quality report of your Ruby code.
gem 'rubycritic', '~> 4.3', '>= 4.3.3', require: false
# Auto completions for SketchUp API.
gem 'sketchup-api-stubs'
# Runtime dependency of skippy for Ruby 3.2. Have it!
gem 'sorted_set', '~> 1.0'
# Aid with common SketchUp extension tasks.
gem 'skippy', '~> 0.5.2.a'
end
gem "sqlite3", "~> 1.4"
+119 -52
View File
@@ -1,74 +1,141 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
backport (1.2.0)
benchmark (0.1.1)
diff-lcs (1.4.4)
e2mmap (0.1.0)
jaro_winkler (1.5.4)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
minitest (5.14.4)
nokogiri (1.12.5-x64-mingw32)
racc (~> 1.4)
nokogiri (1.12.5-x86_64-linux)
racc (~> 1.4)
parallel (1.20.1)
parser (3.0.2.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
childprocess (4.1.0)
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
docile (1.4.0)
equalizer (0.0.11)
erubi (1.11.0)
flay (2.13.0)
erubi (~> 1.10)
path_expander (~> 1.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
flog (4.6.6)
path_expander (~> 1.0)
ruby_parser (~> 3.1, > 3.1.0)
sexp_processor (~> 4.8)
git (1.19.1)
addressable (~> 2.8)
rchardet (~> 1.8)
ice_nine (0.11.2)
iniparse (1.5.0)
kwalify (0.7.2)
launchy (2.5.0)
addressable (~> 2.7)
method_source (1.0.0)
minitest (5.16.3)
naturally (2.2.1)
overcommit (0.59.1)
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
rexml (~> 3.2)
parallel (1.22.1)
parser (3.1.2.1)
ast (~> 2.4.1)
racc (1.6.0)
rainbow (3.0.0)
regexp_parser (2.1.1)
reverse_markdown (2.0.0)
nokogiri
path_expander (1.1.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.1)
rainbow (3.1.1)
rake (13.0.6)
rbtree (0.4.6)
rchardet (1.8.0)
reek (6.1.1)
kwalify (~> 0.7.0)
parser (~> 3.1.0)
rainbow (>= 2.0, < 4.0)
regexp_parser (2.6.0)
rexml (3.2.5)
rubocop (1.19.1)
rubocop (1.7.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.9.1, < 2.0)
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.11.0)
parser (>= 3.0.1.1)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-minitest (0.23.0)
rubocop (>= 0.90, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-sketchup (1.3.0)
rubocop (>= 0.82, < 2.0)
ruby-progressbar (1.11.0)
sketchup-api-stubs (0.7.7)
solargraph (0.43.0)
backport (~> 1.2)
benchmark
bundler (>= 1.17.2)
diff-lcs (~> 1.4)
e2mmap
jaro_winkler (~> 1.5)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
parser (~> 3.0)
reverse_markdown (>= 1.0.5, < 3)
rubocop (>= 0.52)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
sqlite3 (1.4.2)
thor (1.1.0)
tilt (2.0.10)
unicode-display_width (2.0.0)
yard (0.9.26)
ruby_parser (3.19.1)
sexp_processor (~> 4.16)
rubycritic (4.7.0)
flay (~> 2.8)
flog (~> 4.4)
launchy (>= 2.0.0)
parser (>= 2.6.0)
rainbow (~> 3.0)
reek (~> 6.0, < 7.0)
ruby_parser (~> 3.8)
simplecov (>= 0.17.0)
tty-which (~> 0.4.0)
virtus (~> 1.0)
set (1.1.0)
sexp_processor (4.16.1)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sketchup-api-stubs (0.7.8)
skippy (0.5.2.a)
git (~> 1.3)
naturally (~> 2.1)
sorted_set (~> 1.0)
thor (>= 0.19, < 2.0)
sorted_set (1.0.3)
rbtree
set (~> 1.0)
thor (1.3.1)
thread_safe (0.3.6)
tty-which (0.4.2)
unicode-display_width (1.8.0)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
PLATFORMS
x64-mingw-ucrt
x64-mingw32
x64-unknown
x86_64-linux
DEPENDENCIES
minitest
rubocop (~> 1.7)
overcommit
pry
rake
rubocop
rubocop-minitest
rubocop-rake
rubocop-sketchup
rubycritic (~> 4.3, >= 4.3.3)
sketchup-api-stubs
solargraph
sqlite3 (~> 1.4)
skippy (~> 0.5.2.a)
sorted_set (~> 1.0)
BUNDLED WITH
2.2.26
2.3.25
+11
View File
@@ -0,0 +1,11 @@
workflow: GitFlow/v1
next-version: 3.0.0
mode: ManualDeployment
branches:
main:
label: rc
develop:
regex: ^dui3/alpha$
label: beta
unknown:
increment: None
+102 -32
View File
@@ -41,27 +41,42 @@ Give Speckle a try in no time by:
- [![docs](https://img.shields.io/badge/docs-speckle.guide-orange?style=for-the-badge&logo=read-the-docs&logoColor=white)](https://speckle.guide/user/blender.html) reference on almost any end-user and developer functionality
# Repo structure
# Repo structure
This is the beginning of the Speckle SketchUp Connector. It is still in very early development and is not ready for general use.
This repo is split into three parts:
This repo is split into two parts: `speckle_connector` which is the Ruby SketchUp plugin and `ui` which is the Vue frontend.
### 1. **Speckle Connector extension**
Includes the `ruby` source files to run extension on SketchUp environment. SketchUp Extensions are composed of
a **.rb** file as entry and **folder** that .rb file refers to. In our case entry file is `speckle_connector_3.rb`
that responsible to register Speckle Connector extension to SketchUp and also it shows address to where extension
will start to read extension. Source folder is `speckle_connector_3`.
## Usage
### 2. **User Interface**
> NOTE: this connector is still in early development and isn't ready for general use.
Includes the `Vue` frontend lives in the `ui` folder.
Copy the whole `speckle_connector` folder to you SketchUp Plugins folder. You will likely find this at:
### 3. **SketchUp Sqlite3 extension** [submodule](https://github.com/specklesystems/sketchup-sqlite3)
C:\Users\{YOU}\AppData\Roaming\SketchUp\SketchUp 2021\SketchUp\Plugins
Includes source codes of base `SQLite3` C/C++ library and `ruby` compiler files to be able to run SQLite3
functionality on SketchUp in the same ruby module like `SpeckleConnector::Sqlite3::Database`. By this way
we use extensions as native part of the source `ruby` code.
After building `sqlite3.sln` file, compiled `sqlite3.so` (for Windows) and `sqlite3.bundle` (for OSX) dynamic library files are created
by solution to place them into source code into `speckle_connector_3/src/ext`. Building this project should be only
happen when SketchUp starts to support newer Ruby versions (currently it is `2.7`).
You'll need to serve the ui before launching the connector:
## Contribution Guide
cd ui
npm install
npm run serve
Before start to contribute, it is better to understand how align with other contributors. It will make easier job
of reviewer when you submit an issue or PR. If it is your first repo to contribute Speckle environment make sure that you read
[Contribution Guideline](https://github.com/specklesystems/speckle-sharp/blob/main/.github/CONTRIBUTING.md).
Additionally as mentioned on [Repo Structure](#3-sketchup-sqlite3-extension-submodulehttpsgithubcomspecklesystemssketchup-sqlite3),
this repo includes a submodule. Contributions on this source files should be done on the [sketchup-sqlite](https://github.com/specklesystems/sketchup-sqlite3)
by creating issues and PRs on it. If it is your first time works with submodules, please read [git docs](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
briefly to get some insight about it.
## Development
@@ -77,55 +92,89 @@ This should have also have set up the package installer `gem` and interactive ru
gem -v
irb -v
Let's also install our first gem `bundle` which is a package manager that will help us with development.
Let's also install our first gem `bundler` which is a package manager that will help us with development.
gem install bundle
gem install bundler
### Editor Setup
Clone this repo and run:
bundle install
bundler install
This will install all the necessary packages for the connector.
Next, install the Sketchup Ruby Debugger. You can find installation instructions [here](https://github.com/SketchUp/sketchup-ruby-debugger/blob/main/README.md). This will involve downloading the `dll` and copying it into the SketchUp installation directory:
Next, install the Sketchup Ruby Debugger. You can find installation instructions
[here](https://github.com/SketchUp/sketchup-ruby-debugger/blob/main/README.md).
This will involve downloading the `dll` and copying it into the SketchUp installation
directory:
C:\Program Files\SketchUp\SketchUp 2021\
C:\Program Files\SketchUp\SketchUp 20XX\
You can now open up the repo in VS Code.
You can now open up the repo in VS Code or you can use JetBrains' tools RubyMine and Webstorm.
Make sure you've installed the Ruby extension for VS Code.
If you will use VS Code, make sure you've installed the Ruby extension for VS Code.
### Loading the Plugin
#### RubyMine
To tell SketchUp to load the plugin from wherever you happen to be developing, you'll need to create a ruby file with the following contents:
To debug:
- Add configuration as **'Ruby remote debug'**
- Remote host: localhost
- Remote port: 7000
- Remote root folder: <repo_path>
- Local port: 26162
- Local root folder: <repo_path>
- Run below script
```ruby
$LOAD_PATH << 'C:\YOUR\PATH\TO\THE\sketchup_connector'
require 'speckle_connector.rb'
```
bundle exec skippy sketchup:debug 2024
- When sketchup opened, click Debug button on RubyMine
Drop this Ruby file into your SketchUp Plugins directory. You will likely find this at:
### Loading the Speckle Connector Plugin
C:\Users\{YOU}\AppData\Roaming\SketchUp\SketchUp 2021\SketchUp\Plugins
1. Find already prepared `speckle_connector_3_loader.rb` file on the `_tools`
folder.
2. Copy this Ruby file into your SketchUp Plugins directory. You will likely find this at:
`C:\Users\{YOU}\AppData\Roaming\SketchUp\SketchUp 20XX\SketchUp\Plugins`
3. Update below line on the copied file with your local git file.
```ruby
speckle_path = File.join(home_folder, 'Git', 'Speckle', 'speckle-sketchup')
```
By this way SketchUp will directly read your local repository. Do not forget,
this file also loads additional tools on the `_tools` folder.
Those are will be only available on dev mode.
To reload the plugin while SketchUp is running, open up the Ruby console and run the following:
Due to the fact that Ruby is interpreted language, so you can reload your file(s) when
you changed them. There are different kinds of ways to reload them.
SpeckleSystems::SpeckleConnector.reload
1. To reload the whole plugin files while SketchUp is running, open up the Ruby console
and run the following:
```ruby
SpeckleConnector.reload
```
2. To reload only specific files, use `jf ruby toolbar` plugin that already available
on SketchUp toolbar.
To run the `ui`, create a `.env` based on `.env-example` and paste in your Speckle token. Then:
### User Interface
If it is your first time you cloned the project and willing to see Speckle UI, you
should make sure that you compiled the `vue.js` project in the `ui` folder.
To run the `ui`, create a `.env` based on `.env-example` and paste in your
Speckle token. Then:
cd ui
npm run serve
### Debugging
To run SketchUp in debug mode, you will run the task specified in `tasks.json`. Before you do this, make sure your integrated shell for tasks is using powershell. You can specify this by adding the following option to your workspace's `settings.json`
To run SketchUp in debug mode, you will run the task specified in `tasks.json`.
Before you do this, make sure your integrated shell for tasks is using powershell.
You can specify this by adding the following option to your workspace's `settings.json`
"terminal.integrated.automationShell.windows": "powershell.exe",
To start the task, use the keyboard shortcut `ctrl` + `shift` + `p` to open up the Command Palette. Search for `Tasks: Run Task` and select it:
To start the task, use the keyboard shortcut `ctrl` + `shift` + `p` to open up
the Command Palette. Search for `Tasks: Run Task` and select it:
![command palette](https://user-images.githubusercontent.com/7717434/135051668-35fee34e-5270-4b83-9c7b-dabb872370ee.png)
@@ -133,9 +182,30 @@ Then choose the `Debug Sketchup 2021` task to run it:
![debug sketchup task](https://user-images.githubusercontent.com/7717434/135051777-4c350a62-45fb-400e-9b24-4fbb02331b83.png)
Once Sketchup has launched, start the `Listen for rdebug-ide` debug configuration. Once the debugger has connected, you'll be able to debug the connector normally.
Once Sketchup has launched, start the `Listen for rdebug-ide` debug configuration.
Once the debugger has connected, you'll be able to debug the connector normally.
Make sure you run the `ui` before starting the SketchUp Connector
cd ui
npm run serve
npm run serve
### Code Quality
Tracking your code quality before merging any code to `main` branch might not seem at the
first time crucial, but when repo became huge, you might have many spaghetti code and technical
depth. It is always better to keep your work tough from the beginning. For this reason some
workflows have already setup on CI, those workflows must be passed before considering to
merge.
To track your code quality locally,
1. Make sure that you do not have any RuboCop issue, run below
```ruby
bundle exec rake
```
2. To check overall state of repository by RubyCritic, run below
```ruby
rake rubycritic
```
+52
View File
@@ -0,0 +1,52 @@
# frozen_string_literal: true
require 'rake/testtask'
require 'rubocop/rake_task'
require 'rubycritic/rake_task'
module SpeckleConnector
# Custom utility functions for rake tasks
module RakeUtils
module_function
# Find ruby files that were changed from `main` to the latest revision
def changed_rb_files(previous_revision: 'main', latest_revision: '')
range = latest_revision.empty? ? previous_revision : "#{latest_revision}..#{previous_revision}"
command = "git diff #{range} --name-only"
changed_files = `#{command}`.split("\n")
# filter changed files with ruby files (.rb), Gemfile and Rakefile.
filtered_files = changed_files.grep(/.*\.rb$|Gemfile|Rakefile/)
filtered_files.select { |file| File.exist?(file) }
end
end
end
# Add default rubocop task
RuboCop::RakeTask.new(:default)
# Add task to only verify ruby files that are different than in the `main` branch
desc('Run rubocop on changed files')
RuboCop::RakeTask.new(:rubocop_changed) do |t|
t.patterns = FileList.new(SpeckleConnector::RakeUtils.changed_rb_files)
end
# Glob pattern to match source files. Defaults to FileList['.'].
ruby_critic_paths = FileList[
'speckle_connector_3/**/*.rb',
'speckle_connector_3.rb',
'tests/**/*.rb'] -
FileList[
'_tools/**/*.rb',
'speckle_connector_3/src/ext/**/*.rb',
]
# for local
RubyCritic::RakeTask.new('rubycritic') do |task|
task.paths = ruby_critic_paths
end
# for CI
RubyCritic::RakeTask.new('rubycritic-ci') do |task|
task.options = '--mode-ci --format console --no-browser --branch main'
task.paths = ruby_critic_paths
end
Submodule
+1
Submodule _sqlite3 added at 3cce3fb807
+25
View File
@@ -0,0 +1,25 @@
# Tools
This folder stores the external tools and helper scripts to make easier life of the developer,
they are not the part of the main functionality of the Speckle.
Tools and scripts inside the folder will be loaded with `sketchup_connector_loader.rb` file.
In order to load your own `.rb` files please add this file names into list in the loader.
````ruby
...
files = %w[speckle_connector jf_RubyPanel su_attributes <put-your-file-here>]
# This line placed before loading started.
files.each do |ruby_file|
puts "Loading #{ruby_file}"
begin
require ruby_file
rescue LoadError
puts "Could not load #{ruby_file}"
end
end
````
Track load status of your tools and scripts on the ruby console when SketchUp UI initializing.
+15
View File
@@ -0,0 +1,15 @@
# This is for automated pre-debugger configuration.
# We run skippy first, then activate debugger.
# The purpose of this file to wait till skp is live
# To establish a configuration
# 1. Create 'Run External Tool' before lunch step
# 2. Program -> C:\Ruby32-x64\bin\ruby.exe or whatever
# 3. Arguments -> C:\Users\KORAL\Documents\Git\Speckle\speckle-sketchup\_tools\debugger\bundle_exec_2024.rb or whatever
# 4. Working directory -> C:\Users\KORAL\Documents\Git\Speckle\speckle-sketchup or whatever
# Add a delay of 10 seconds, it is arbitrary, do not hesitate to change for what works best for you
sleep(10)
# Execute the original command
exec('bundle exec skippy sketchup:debug 2024')
+29
View File
@@ -0,0 +1,29 @@
# frozen_string_literal: true
# #-------------------------------------------------------------------------------------------------
# *************************************************************************************************
# RubyPanel Toolbar (C) 2007 jim.foltz@gmail.com
#
# With special thanks to Chris Phillips (Sketchy Physics)
# for the Win32API code examples.
#
# 2011-01-05 <jim.foltz@gmail.com>
# * Changed Toolbar name from "Ruby COnsole" to "Ruby Toolbar" (TT)
# http://forums.sketchucation.com/viewtopic.php?f=323&t=1542&p=298587#p298587
# * Wrapped in addition module RubyToolbar
# * Use $suString.GetSting to get proper "Ruby Console" name string.
# * Better check if TB was previously visible
# * Use UI.start_timer to restore Toolbar
# ICONS: located in the subfolder "rubytoolbar"
# MODIFICATION: by Fredo6 for compliance with SU 2014 (and no dependency on Win32API) - 18 Sep 2013
# *************************************************************************************************
#-------------------------------------------------------------------------------------------------
require 'sketchup'
require 'extensions'
ext = SketchupExtension.new('Ruby Toolbar', 'jf_RubyPanel/rubytoolbar.rb')
ext.creator = 'Jim Foltz <jim.foltz@gmail.com>'
ext.description = 'Toolbar for manipulating the Ruby Console. Compatible with SketchUp 2014'
ext.version = '2014'
Sketchup.register_extension(ext, true)
Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+89
View File
@@ -0,0 +1,89 @@
# frozen_string_literal: true
#-------------------------------------------------------------------------------------------------------------------------------------------------
# RubyPanel Toolbar (C) 2007 jim.foltz@gmail.com
# Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies.
# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
# Description: Manage the loading of Ruby files and display of the Ruby console
# CREDITS: Special thanks to Chris Phillips (Sketchy Physics) for the Win32API code examples
# Revision: 3 Aug 2009, by Fredo6
# ICONS: located in the subfolder "rubytoolbar"
# MODIFICATION: by Fredo6 for compliance with SU 2014 (and no dependency on Win32API) - 18 Sep 2013
#-------------------------------------------------------------------------------------------------------------------------------------------------
require 'English'
require 'sketchup'
module JF_RubyToolbar
# Load the toolbar icons and commands, and do some initialization
def self.load_toolbar
@last_dir = "#{$LOAD_PATH[0]}/"
@last_dir = @last_dir.gsub('/', '\\\\\\\\')
@last_dir = File.join($JF_RUBYTOOLBAR, 'speckle_connector_3')
curdir = File.dirname __FILE__
# create toolbar
tb = UI::Toolbar.new 'Ruby Toolbar'
# Toggle console
cmd = UI::Command.new('Show/Hide') { SKETCHUP_CONSOLE.visible? ? SKETCHUP_CONSOLE.hide : SKETCHUP_CONSOLE.show }
cmd.large_icon = cmd.small_icon = File.join(curdir, 'rubypanel.png')
cmd.status_bar_text = cmd.tooltip = 'Show/Hide Ruby Console'
tb.add_item cmd
# Clear Console
cmd = UI::Command.new('Clear') { SKETCHUP_CONSOLE.clear }
cmd.status_bar_text = cmd.tooltip = 'Clear Console'
cmd.large_icon = cmd.small_icon = File.join(curdir, 'Delete24.png')
tb.add_item cmd
# Load a Ruby script
cmd = UI::Command.new('LoadScript') { load_script }
cmd.large_icon = cmd.small_icon = File.join(curdir, 'doc_ruby.png')
cmd.tooltip = cmd.status_bar_text = 'Load Script'
tb.add_item cmd
# Reload the last Ruby Script
@cmd_reload = UI::Command.new('Reload') { load_script @last_file }
@cmd_reload.large_icon = @cmd_reload.small_icon = File.join(curdir, 'reload.png')
@cmd_reload.status_bar_text = @cmd_reload.tooltip = 'Reload Script'
tb.add_item @cmd_reload
# Open the SU plugins directory panel
cmd = UI::Command.new('PluginsDir') { UI.openURL @last_dir }
cmd.tooltip = cmd.status_bar_text = 'Browse Plugins Folder'
cmd.large_icon = cmd.small_icon = File.join(curdir, 'open_folder.png')
tb.add_item cmd
# showing the toolbar
tb.get_last_state == -1 ? tb.show : tb.restore
end
# Load a script file - if <file> is nil, open the dialog panel to select the file
def self.load_script(file = nil)
file ||= UI.openpanel 'Load Script', @last_dir, '*.rb*'
return unless file
begin
load file
Sketchup.set_status_text "#{File.basename(file)} loaded (#{Time.now.strftime('%H:%M:%S')})"
@last_file = file
@last_dir = "#{File.dirname(file)}/"
@last_dir = @last_dir.gsub('/', '\\\\\\\\')
@cmd_reload.status_bar_text = @cmd_reload.tooltip = "Reload Script: #{File.basename(file)}"
rescue StandardError
UI.messagebox("Couldn't load #{File.basename(file)}: #{$ERROR_INFO}")
end
end
# Loading the toolbar once
unless file_loaded?('RubyToolbar.rb')
load_toolbar
file_loaded('RubyToolbar.rb')
end
end
+44
View File
@@ -0,0 +1,44 @@
# frozen_string_literal: true
# The purpose of this file is customizing environment of the developer on SketchUp.
# Each developer can customize it's own loader(this file), by this way developer can load their helper tools
# and helper methods ONLY in dev mode.
# Change the base folder and copy this file to Sketchup Plugins directory
# If you need to test in several versions of SketchUp, create symlinks to this file
# ( AppData\Roaming\SketchUp\SketchUp <version>\SketchUp\Plugins )
# Create a link to Plugins folder with this command
# rubocop:disable Layout/LineLength
# New-Item -ItemType SymbolicLink -Path '~\AppData\Roaming\SketchUp\SketchUp 2022\SketchUp\Plugins\speckle_connector_3_loader.rb' -Target ~\Git\Speckle\speckle-sketchup\_tools\speckle_connector_3_loader.rb
# rubocop:enable Layout/LineLength
SKETCHUP_CONSOLE.show # if you want to show Ruby console on startup
# base location of your repos - will be merged with specific repos in next step
home_folder = File.expand_path('~')
# If you use some other location for your repository, you can change it here
# but make sure it is not committed as it will change thi setting for all
# users that use the default setup. Eg:
# Add Speckle folder - uncomment the one you need
speckle_path = File.join(home_folder, 'Git', 'Speckle', 'speckle-sketchup')
$LOAD_PATH << speckle_path
$LOAD_PATH << File.join(speckle_path, '_tools')
# Defining this path will help to tool to browse related source file directly when
# developer attempted to reload/load file.
# rubocop:disable Style/GlobalVars
$JF_RUBYTOOLBAR = speckle_path
# rubocop:enable Style/GlobalVars
files = %w[speckle_connector_3 jf_RubyPanel su_attributes]
files.each do |ruby_file|
puts "Loading #{ruby_file}"
begin
require ruby_file
rescue LoadError
puts "Could not load #{ruby_file}"
end
end
+49
View File
@@ -0,0 +1,49 @@
# Copyright 2014-2021, Trimble Inc.
#
# License: The MIT License (MIT)
#
# A SketchUp Ruby Extension that surfaces attributes attached to components.
# More info at https://github.com/SketchUp/sketchup-attribute-helper
require 'sketchup.rb'
require 'extensions.rb'
#-------------------------------------------------------------------------------
module Trimble
module AttributeHelper
### CONSTANTS ### ------------------------------------------------------------
# Plugin information
PLUGIN_ID = 'AttributeHelper'.freeze
PLUGIN_NAME = 'SketchUp Attribute Helper'.freeze
PLUGIN_VERSION = '1.0.3'.freeze
# Resource paths
FILENAMESPACE = File.basename(__FILE__, '.*')
PATH_ROOT = File.dirname(__FILE__).freeze
PATH = File.join(PATH_ROOT, FILENAMESPACE).freeze
### EXTENSION ### ------------------------------------------------------------
unless file_loaded?(__FILE__)
loader = File.join( PATH, 'core.rb' )
ex = SketchupExtension.new(PLUGIN_NAME, loader)
ex.description = 'Visually inspect nested attributes in SketchUp.'
ex.version = PLUGIN_VERSION
ex.copyright = 'Trimble Inc © 2015-2021'
ex.creator = 'SketchUp'
Sketchup.register_extension(ex, true)
end
end # module AttributeHelper
end # module Trimble
#-------------------------------------------------------------------------------
file_loaded(__FILE__)
#-------------------------------------------------------------------------------
+285
View File
@@ -0,0 +1,285 @@
# Copyright 2014-2021, Trimble Inc.
#
# License: The MIT License (MIT)
require "sketchup.rb"
require "stringio"
module Trimble
module AttributeHelper
PLUGIN = self
class << self
attr_reader :app_observer
attr_reader :model_observer
attr_reader :selection_observer
end
def self.visualize_selected
content = self.traverse_selected
html = self.wrap_content(content)
options = {
:dialog_title => "Attribute Visualizer",
:preferences_key => 'AttributeVisualizer',
:scrollable => true,
:resizable => true,
:height => 300,
:width => 400,
:left => 200,
:top => 200
}
@window ||= UI::WebDialog.new(options)
@window.set_html(html)
@window.set_on_close {
@window = nil
self.detach_observers
}
unless @window.visible?
@window.show
self.attach_observers
end
end
def self.attach_observers
@app_observer ||= AppObserver.new
@model_observer ||= ModelObserver.new
@selection_observer ||= SelectionObserver.new
model = Sketchup.active_model
Sketchup.remove_observer(@app_observer)
model.remove_observer(@model_observer)
model.selection.remove_observer(@selection_observer)
Sketchup.add_observer(@app_observer)
model.add_observer(@model_observer)
model.selection.add_observer(@selection_observer)
end
def self.detach_observers
Sketchup.remove_observer(@app_observer)
Sketchup.active_model.remove_observer(@model_observer)
Sketchup.active_model.selection.remove_observer(@selection_observer)
end
def self.traverse_selected
html = StringIO.new
model = Sketchup.active_model
selection = model.selection
if selection.empty?
if model.active_path.nil?
entity = model
else
entity = model.active_path.last
end
else
return "Invalid selection size" unless selection.size == 1
entity = selection[0]
end
html.puts "<h1>#{self.escape_html(entity)}</h1>"
if entity.respond_to?(:name)
html.puts "<h2>#{self.escape_html(entity.name)}</h2>"
end
if entity.attribute_dictionaries
entity.attribute_dictionaries.each { |dictionary|
html.puts self.format_dictionary(dictionary)
}
else
html.puts "No dictionaries"
end
if entity.is_a?(Sketchup::Group)
definition = entity.entities.parent
elsif entity.is_a?(Sketchup::ComponentInstance)
definition = entity.definition
else
definition = nil
end
if definition && definition.attribute_dictionaries
html.puts "<h1>#{self.escape_html(definition)}</h1>"
html.puts "<h2>#{self.escape_html(definition.name)}</h2>"
definition.attribute_dictionaries.each { |dictionary|
html.puts self.format_dictionary(dictionary)
}
end
html.string
end
def self.format_dictionary(dictionary, path = "")
html_name = self.escape_html(dictionary.name)
path = "#{path}:#{html_name}"
html = StringIO.new
html.puts "<table>"
html.puts "<caption title='#{path}'>#{html_name}</caption>"
html.puts "<tbody>"
dictionary.each { |key, value|
html_key = self.escape_html(key)
html_value = self.escape_html(value)
node_path = "#{path}:#{html_key}"
html.puts "<tr title='#{node_path}'><td>#{html_key}</td><td>#{html_value}</td><td class='value_type'>#{value.class}</td></tr>"
}
if dictionary.attribute_dictionaries
dictionary.attribute_dictionaries.each { |sub_dic|
html.puts "<tr><td colspan='3' class='dictionary'>"
html.puts self.format_dictionary(sub_dic, path)
html.puts "</td></tr>"
}
end
html.puts "</tbody>"
html.puts "</table>"
html.string
end
def self.escape_html(data)
data.to_s.gsub("&", "&amp;").gsub("<", "&lt;").gsub(">", "&gt;")
end
def self.wrap_content(content)
html = <<-EOT
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="UTF-8">
<style>
html {
font-family: "Calibri", sans-serif;
font-size: 10pt;
}
h1 {
font-size: 1.5em;
}
h2 {
font-size: 1.2em;
}
table {
width: 100%;
/*padding: 0.5em;*/
border: 1px solid #666;
}
caption {
font-weight: bold;
text-align: left;
/*border-bottom: 1px solid silver;*/
padding: 0.2em;
}
td {
background: #f3f3f3;
padding: 0.2em;
}
td.dictionary {
background: none;
padding-left: 1em;
}
tr:hover td {
background: rgba(255,210,180,0.2);
}
.value_type {
text-align: right;
width: 5%;
}
</style>
<head>
<body>
#{content}
</body>
</html>
EOT
end
class SelectionObserver < Sketchup::SelectionObserver
def onSelectionAdded(selection, element)
selection_changed()
end
def onSelectionBulkChange(selection)
selection_changed()
end
def onSelectionCleared(selection)
selection_changed()
end
def onSelectionRemoved(selection, element)
selection_changed()
end
private
def selection_changed
PLUGIN.visualize_selected
end
end # class SelectionObserver
class ModelObserver < Sketchup::ModelObserver
def onActivePathChanged(model)
PLUGIN.visualize_selected
end
def onTransactionCommit(model)
model_changed(model)
end
def onTransactionEmpty(model)
model_changed(model)
end
def onTransactionRedo(model)
model_changed(model)
end
def onTransactionUndo(model)
model_changed(model)
end
private
def model_changed(model)
if @timer.nil?
@timer = UI.start_timer(0.0, false) {
@timer = nil
PLUGIN.visualize_selected
}
end
end
end # class ModelObserver
class AppObserver < Sketchup::AppObserver
def onNewModel(model)
observe_model(model)
end
def onOpenModel(model)
observe_model(model)
end
private
def observe_model(model)
model.add_observer(PLUGIN.model_observer)
model.selection.add_observer(PLUGIN.selection_observer)
PLUGIN.visualize_selected
end
end # class AppObserver
unless file_loaded?(__FILE__)
command = UI::Command.new("Attribute Helper") { self.visualize_selected }
command.status_bar_text = "Inspect and edit the attributes of a selection."
menu_name = Sketchup.version.to_f < 21.1 ? 'Plugins' : 'Developer'
menu = UI.menu(menu_name)
menu.add_item(command)
file_loaded(__FILE__)
end
end # module AttributeHelper
end # module Sketchup
+2
View File
@@ -0,0 +1,2 @@
ID=f4d9d053-4479-4a9a-90da-b79fa16e28c4
VERSION_ID=b787af5e-8e8e-4932-92ef-a3c99681795d
Binary file not shown.
-15
View File
@@ -1,15 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "bundler/setup"
require "speckle_connector"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
require "irb"
IRB.start(__FILE__)
-8
View File
@@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx
bundle install
# Do any other automated setup that you need to do here
-8
View File
@@ -1,8 +0,0 @@
# frozen_string_literal: true
require_relative "speckle_connector/version"
module SpeckleConnector
class Error < StandardError; end
# Your code goes here...
end
-5
View File
@@ -1,5 +0,0 @@
# frozen_string_literal: true
module SpeckleConnector
VERSION = "0.1.0"
end
+11 -4
View File
@@ -4,7 +4,7 @@ import sys
def patch_connector(tag):
"""Patches the connector version within the connector file"""
rb_file = "speckle_connector.rb"
rb_file = "speckle_connector_3.rb"
with open(rb_file, "r") as file:
lines = file.readlines()
@@ -15,6 +15,12 @@ def patch_connector(tag):
print(f"Patched connector version number in {rb_file}")
break
for (index, line) in enumerate(lines):
if 'DEV_MODE = ' in line:
lines[index] = f' DEV_MODE = false\n'
print(f"Patched dev mode to false in {rb_file}")
break
with open(rb_file, "w") as file:
file.writelines(lines)
@@ -25,7 +31,8 @@ def patch_installer(tag):
with open(iss_file, "r") as file:
lines = file.readlines()
lines.insert(11, f'#define AppVersion "{tag}"\n')
lines.insert(11, f'#define AppVersion "{tag.split("-")[0]}"\n')
lines.insert(12, f'#define AppInfoVersion "{tag}"\n')
with open(iss_file, "w") as file:
file.writelines(lines)
@@ -39,12 +46,12 @@ def main():
return
tag = sys.argv[1]
if not re.match(r"[0-9]+(\.[0-9]+)*$", tag):
if not re.match(r"([0-9]+)\.([0-9]+)\.([0-9]+)", tag):
raise ValueError(f"Invalid tag provided: {tag}")
print(f"Patching version: {tag}")
patch_connector(tag)
patch_installer(tag)
# patch_installer(tag)
if __name__ == "__main__":
-59
View File
@@ -1,59 +0,0 @@
require "net/http"
require "json"
require "uri"
server = "https://latest.speckle.dev"
token = "1dc2e3330a56371dc9011e5bed406264c9e65dd355"
limit = 20
streams_list = "
query User {
user {
id
email
name
bio
company
avatar
verified
profiles
role
streams(limit: #{limit}) {
totalCount
cursor
items {
id
name
description
isPublic
createdAt
updatedAt
collaborators {
id
name
role
}
}
}
}
}
"
endpoint = URI("#{server}/graphql")
res =
::Net::HTTP.start(endpoint.host, endpoint.port, use_ssl: true) do |http|
req = ::Net::HTTP::Post.new(endpoint)
req["Content-Type"] = "application/json"
req["Authorization"] = "Bearer #{token}"
# The body needs to be a JSON string.
req.body = ::JSON[{ query: streams_list }]
puts(req.body)
http.request(req)
end
streams = ::JSON.parse(res.body)["data"]["user"]["streams"]["items"]
puts(streams)
-45
View File
@@ -1,45 +0,0 @@
require "sketchup"
require "extensions"
module SpeckleSystems
module SpeckleConnector
# Version - patched by CI
CONNECTOR_VERSION = "0.0.0"
file = __FILE__.dup
# Account for Ruby encoding bug under Windows.
file.force_encoding("UTF-8") if file.respond_to?(:force_encoding)
# Support folder should be named the same as the root .rb file.
folder_name = File.basename(file, ".*")
# Path to the root .rb file (this file).
PATH_ROOT = File.dirname(file).freeze
# Path to the support folder.
PATH = File.join(PATH_ROOT, folder_name).freeze
# Run from localhost or from build files
DEV_MODE = false
puts("Loading Speckle Connector v#{CONNECTOR_VERSION} from #{DEV_MODE ? 'dev' : 'build'}")
unless file_loaded?(__FILE__)
ex = SketchupExtension.new("Speckle SketchUp", File.join(PATH, "main"))
ex.description = "Speckle Connector for SketchUp"
ex.version = CONNECTOR_VERSION
ex.copyright = "AEC Systems Ltd."
ex.creator = "Speckle Systems"
Sketchup.register_extension(ex, true)
file_loaded(__FILE__)
end
end
end
-54
View File
@@ -1,54 +0,0 @@
require "JSON"
begin
require("sqlite3")
rescue LoadError
# ty msp-greg! https://github.com/MSP-Greg/SUMisc/releases/tag/sqlite3-mingw-1
Gem.install(File.join(File.dirname(File.expand_path(__FILE__)), "utils/sqlite3-1.4.2.mspgreg-x64-mingw32.gem"))
else
require("sqlite3")
end
module SpeckleSystems::SpeckleConnector
module Accounts
def self.load_accounts
dir = _get_speckle_dir
db_path = File.join(dir, "Accounts.db")
unless File.exist?(db_path)
raise(IOError, "No Accounts db found. Please read the guide for different options for adding your account: \nhttps://speckle.guide/user/manager.html#adding-accounts")
end
db = SQLite3::Database.new(db_path)
rows = db.execute("SELECT * FROM objects")
db.close
rows.map { |row| JSON.parse(row[1]) }
end
def self.get_suuid
dir = _get_speckle_dir
suuid_path = File.join(dir, "suuid")
return unless File.exist?(suuid_path)
File.read(suuid_path)
end
def self._get_speckle_dir
platform = RUBY_PLATFORM.downcase
speckle_dir =
if platform =~ (/mingw/) || platform =~ (/win/)
# win
File.join(Dir.home, "AppData/Roaming/Speckle")
elsif platform =~ /linux/
# linux
File.expand_path("~/.local/share/Speckle")
else
# mac
File.expand_path("~/.config/Speckle")
end
return speckle_dir if Dir.exist?(speckle_dir)
raise(IOError, "No Speckle Directory exists. Please read the guide to get Speckle set up on your machine: \nhttps://speckle.guide/user/manager.html")
end
end
end
@@ -1,30 +0,0 @@
require "sketchup"
require "speckle_connector/converter/to_speckle"
require "speckle_connector/converter/to_native"
module SpeckleSystems::SpeckleConnector
SKETCHUP_UNIT_STRINGS = { "m" => "m", "mm" => "mm", "ft" => "feet", "in" => "inch", "yd" => "yard" }.freeze
public_constant :SKETCHUP_UNIT_STRINGS
class ConverterSketchup
include ToNative
include ToSpeckle
attr_accessor :units, :component_defs
def initialize(units = "m")
@units = units
@component_defs = {}
end
def convert_to_speckle(obj)
case obj.typename
when "Edge" then edge_to_speckle(obj)
when "Face" then face_to_speckle(obj)
when "Group" then component_instance_to_speckle(obj, is_group: true)
when "ComponentDefinition" then component_definition_to_speckle(obj)
when "ComponentInstance" then component_instance_to_speckle(obj)
else nil
end
end
end
end
-150
View File
@@ -1,150 +0,0 @@
require "sketchup"
# To Native conversions for the ConverterSketchup
module SpeckleSystems::SpeckleConnector::ToNative
def traverse_commit_object(obj)
if can_convert_to_native(obj)
convert_to_native(obj, Sketchup.active_model.entities)
elsif obj.is_a?(Hash) && obj.key?("speckle_type")
props = obj.keys.filter_map { |key| key if key.start_with?("@") }
%w[displayMesh displayValue data].each { |prop| props.push(prop) if obj.key?(prop) }
props.each { |prop| traverse_commit_object(obj[prop]) }
elsif obj.is_a?(Hash)
obj.each_value { |value| traverse_commit_object(value) }
elsif obj.is_a?(Array)
obj.each { |value| traverse_commit_object(value) }
else
nil
end
end
def can_convert_to_native(obj)
return false unless obj.is_a?(Hash) && obj.key?("speckle_type")
[
"Objects.Geometry.Line",
"Objects.Geometry.Polyline",
"Objects.Geometry.Mesh",
"Objects.Other.BlockInstance",
"Objects.Other.BlockDefinition",
"Objects.Other.RenderMaterial"
].include?(obj["speckle_type"])
end
def convert_to_native(obj, entities = SketchUp.active_model.entities)
case obj["speckle_type"]
when "Objects.Geometry.Line", "Objects.Geometry.Polyline" then edge_to_native(obj, entities)
when "Objects.Other.BlockInstance" then component_instance_to_native(obj, entities)
when "Objects.Other.BlockDefinition" then component_definition_to_native(obj)
when "Objects.Geometry.Mesh" then mesh_to_native(obj, entities)
else
nil
end
# rescue StandardError => e
# puts("Failed to convert #{obj["speckle_type"]} (id: #{obj["id"]})")
# puts(e)
# nil
end
def length_to_native(length, units = @units)
length.__send__(SpeckleSystems::SpeckleConnector::SKETCHUP_UNIT_STRINGS[units])
end
def edge_to_native(line, entities)
return unless line.key?("value")
values = line["value"]
points = values.each_slice(3).to_a.map { |pt| point_to_native(pt[0], pt[1], pt[2], line["units"]) }
entities.add_edges(*points)
end
def face_to_native
nil
end
def point_to_native(x, y, z, units)
Geom::Point3d.new(length_to_native(x, units), length_to_native(y, units), length_to_native(z, units))
end
def component_definition_to_native(block_def)
definition = Sketchup.active_model.definitions[block_def["name"]]
return definition if definition&.guid == block_def["applicationId"]
definition&.entities&.clear!
definition ||= Sketchup.active_model.definitions.add(block_def["name"])
block_def["geometry"].each { |obj| convert_to_native(obj, definition.entities) }
definition
end
def mesh_to_native(mesh, entities)
native_mesh = Geom::PolygonMesh.new
points = [] # to preserve indices - duplicate points won't be added in `point_to_native`
mesh["vertices"].each_slice(3) do |pt|
points.push(point_to_native(pt[0], pt[1], pt[2], mesh["units"]))
end
faces = mesh["faces"]
while faces.count.positive?
size = faces.shift
num_pts =
case size
when 0 then 3
when 1 then 4
else size
end
indices = faces.shift(num_pts)
native_mesh.add_polygon(indices.map { |index| points[index] })
end
entities.add_faces_from_mesh(native_mesh, 4, material_to_native(mesh["renderMaterial"]))
native_mesh
end
def component_instance_to_native(block, entities)
is_group = block.key?("is_sketchup_group") && block["is_sketchup_group"]
definition = component_definition_to_native(block["blockDefinition"])
# return unless definition.entities.count.positive?
transform = transform_to_native(block["transform"], block["units"])
instance =
if is_group
entities.add_group(definition.entities.to_a)
else
entities.add_instance(definition, transform)
end
puts("Failed to create instance for speckle object #{block["id"]}") if instance.nil?
instance.transformation = transform if is_group
instance.material = material_to_native(block["renderMaterial"])
instance
end
def transform_to_native(t_arr, units = @units)
Geom::Transformation.new(
[
t_arr[0], t_arr[4], t_arr[8], t_arr[12],
t_arr[1], t_arr[5], t_arr[9], t_arr[13],
t_arr[2], t_arr[6], t_arr[10], t_arr[14],
length_to_native(t_arr[3], units),
length_to_native(t_arr[7], units),
length_to_native(t_arr[11], units),
t_arr[15]
]
)
end
def material_to_native(render_mat)
return if render_mat.nil?
# return material with same name if it exists
name = render_mat["name"] || render_mat["id"]
material = Sketchup.active_model.materials[name]
return material if material
# create a new sketchup material
material = Sketchup.active_model.materials.add(name)
material.alpha = render_mat["opacity"]
argb = render_mat["diffuse"]
material.color = Sketchup::Color.new((argb >> 16) & 255, (argb >> 8) & 255, argb & 255, (argb >> 24) & 255)
material
end
end
-228
View File
@@ -1,228 +0,0 @@
require "sketchup"
# To Speckle conversions for the ConverterSketchup
module SpeckleSystems::SpeckleConnector::ToSpeckle
def length_to_speckle(length)
length.__send__("to_#{SpeckleSystems::SpeckleConnector::SKETCHUP_UNIT_STRINGS[@units]}")
end
def edge_to_speckle(edge)
{
speckle_type: "Objects.Geometry.Line",
applicationId: edge.persistent_id.to_s,
units: @units,
start: vertex_to_speckle(edge.start),
end: vertex_to_speckle(edge.end),
domain: speckle_interval(0, Float(edge.length)),
bbox: bounds_to_speckle(edge.bounds)
}
end
def component_definition_to_speckle(definition)
guid = definition.guid
return @component_defs[guid] if @component_defs.key?(guid)
speckle_def = {
speckle_type: "Objects.Other.BlockDefinition",
applicationId: guid,
units: @units,
name: definition.name,
# i think the base point is always the origin?
basePoint: speckle_point,
"@geometry" => if %w[Edge Face].include?(definition.entities[0].typename)
group_mesh_to_speckle(definition)
else
definition.entities.map { |entity| convert_to_speckle(entity) }
end
}
@component_defs[guid] = speckle_def
end
def component_instance_to_speckle(instance, is_group: false)
transform = instance.transformation
origin = transform.origin
{
speckle_type: "Objects.Other.BlockInstance",
applicationId: instance.guid,
is_sketchup_group: is_group,
units: @units,
bbox: bounds_to_speckle(instance.bounds),
name: instance.name,
renderMaterial: instance.material.nil? ? nil : material_to_speckle(instance.material),
transform: transform_to_speckle(transform),
insertionPoint: speckle_point(origin[0], origin[1], origin[2]),
"@blockDefinition" => component_definition_to_speckle(instance.definition)
}
end
def group_mesh_to_speckle(component_def)
mat_groups = {}
component_def.entities.each do |face|
next unless face.typename == "Face"
# convert material
mat_id = face.material.nil? ? "none" : face.material.entityID
mat_groups[mat_id] = initialise_group_mesh(face, component_def.bounds) unless mat_groups.key?(mat_id)
# add points and texture coordinates
mesh = face.mesh(1)
mat_groups[mat_id]["@(31250)vertices"].push(*points_to_array(mesh))
mat_groups[mat_id]["@(31250)textureCoordinates"].push(*uvs_to_array(mesh))
# add faces
mat_groups[mat_id]["@(62500)faces"].push(*faces_to_array(mesh, mat_groups[mat_id][:pt_count]))
mat_groups[mat_id][:pt_count] += mesh.points.count
end
mat_groups.values.map { |group| group.delete(:pt_count) }
mat_groups.values
end
def transform_to_speckle(transform)
t_arr = transform.to_a
[
t_arr[0], t_arr[4], t_arr[8], length_to_speckle(t_arr[12]),
t_arr[1], t_arr[5], t_arr[9], length_to_speckle(t_arr[13]),
t_arr[2], t_arr[6], t_arr[10], length_to_speckle(t_arr[14]),
t_arr[3], t_arr[7], t_arr[11], t_arr[15]
]
end
def initialise_group_mesh(face, bounds)
{
speckle_type: "Objects.Geometry.Mesh",
units: @units,
bbox: bounds_to_speckle(bounds),
"@(31250)vertices" => [],
"@(62500)faces" => [],
"@(31250)textureCoordinates" => [],
pt_count: -1, # faces are 1 indexed
renderMaterial: face.material.nil? ? nil : material_to_speckle(face.material)
}
end
def faces_to_array(mesh, offset)
faces = []
mesh.polygons.each do |poly|
faces.push(
case poly.count
when 3 then 0 # tris
when 4 then 1 # polys
else
poly.count # ngons
end,
*poly.map { |coord| coord.abs + offset }
)
end
faces
end
def points_to_array(mesh)
pts_array = []
mesh.points.each do |pt|
pts_array.push(
length_to_speckle(pt[0]),
length_to_speckle(pt[1]),
length_to_speckle(pt[2])
)
end
pts_array
end
def uvs_to_array(mesh)
uvs_array = []
mesh.uvs(true).each do |pt|
uvs_array.push(
length_to_speckle(pt[0] / pt[2]),
length_to_speckle(pt[1] / pt[2])
)
end
uvs_array
end
def face_to_speckle(face)
mesh = face.mesh(1)
{
speckle_type: "Objects.Geometry.Mesh",
units: @units,
renderMaterial: face.material.nil? ? nil : material_to_speckle(face.material),
bbox: bounds_to_speckle(face.bounds),
"@(31250)vertices" => points_to_array(mesh),
"@(62500)faces" => faces_to_array(mesh, -1),
"@(31250)textureCoordinates" => uvs_to_array(mesh)
}
end
def vertex_to_speckle(vertex)
point = vertex.position
{
speckle_type: "Objects.Geometry.Point",
units: @units,
x: length_to_speckle(point[0]),
y: length_to_speckle(point[1]),
z: length_to_speckle(point[2])
}
end
def material_to_speckle(material)
rgba = material.color.to_a
{
speckle_type: "Objects.Other.RenderMaterial",
name: material.name,
diffuse: [rgba[3] << 24 | rgba[0] << 16 | rgba[1] << 8 | rgba[2]].pack("l").unpack1("l"),
opacity: material.alpha,
emissive: -16_777_216,
metalness: 0,
roughness: 1
}
end
def bounds_to_speckle(bounds)
min_pt = bounds.min
{
speckle_type: "Objects.Geometry.Box",
units: @units,
area: 0,
volume: 0,
xSize: speckle_interval(min_pt[0], bounds.width),
ySize: speckle_interval(min_pt[1], bounds.height),
zSize: speckle_interval(min_pt[2], bounds.depth),
basePlane: speckle_plane
}
end
def speckle_interval(start_val, end_val)
{
speckle_type: "Objects.Primitive.Interval",
units: @units,
start: start_val.is_a?(Length) ? length_to_speckle(start_val) : start_val,
end: end_val.is_a?(Length) ? length_to_speckle(end_val) : end_val
}
end
def speckle_point(x = 0.0, y = 0.0, z = 0.0, vector: false)
{
speckle_type: vector ? "Objects.Geometry.Vector" : "Objects.Geometry.Point",
units: @units,
x: x.is_a?(Length) ? length_to_speckle(x) : x,
y: y.is_a?(Length) ? length_to_speckle(y) : y,
z: z.is_a?(Length) ? length_to_speckle(z) : z
}
end
def speckle_vector(x = 0.0, y = 0.0, z = 0.0)
speckle_point(x, y, z, vector: true)
end
def speckle_plane(xdir: [1, 0, 0], ydir: [0, 1, 0], normal: [0, 0, 1], origin: [0, 0, 0])
{
speckle_type: "Objects.Geometry.Plane",
units: @units,
xdir: speckle_vector(*xdir),
ydir: speckle_vector(*ydir),
normal: speckle_vector(*normal),
origin: speckle_point(*origin)
}
end
end
-17
View File
@@ -1,17 +0,0 @@
module SpeckleSystems::SpeckleConnector
# from thomthom
# https://github.com/thomthom/true-bend/blob/master/src/tt_truebend/debug.rb
# @note Debug method to reload the plugin.
#
# @example
# SpeckleSystems::SpeckleConnector.reload
#
# @return [Integer] Number of files reloaded.
def self.reload
load(__FILE__)
pattern = File.join(__dir__, "**/*.rb")
Dir.glob(pattern).each { |file| load(file) }
.size
end
end
-90
View File
@@ -1,90 +0,0 @@
require "JSON"
require "json"
require "sketchup"
require "speckle_connector/converter/converter_sketchup"
require "speckle_connector/accounts"
module SpeckleSystems::SpeckleConnector
UNITS = { 0 => "in", 1 => "ft", 2 => "mm", 3 => "cm", 4 => "m", 5 => "yd" }.freeze
public_constant :UNITS
def self.create_dialog
options = {
dialog_title: "SpeckleSketchUp",
preferences_key: "example.htmldialog.materialinspector",
style: UI::HtmlDialog::STYLE_DIALOG,
min_width: 250,
min_height: 50
}
dialog = UI::HtmlDialog.new(options)
dialog.center
dialog
end
def self.show_dialog
if @dialog&.visible?
@dialog.bring_to_front
else
@dialog ||= create_dialog
@dialog.add_action_callback("send_selection") do |_action_context, stream_id|
send_selection(stream_id)
nil
end
@dialog.add_action_callback("receive_objects") do |_action_context, base, stream_id|
receive_objects(base, stream_id)
nil
end
@dialog.add_action_callback("reload_accounts") do |_action_context|
reload_accounts
end
@dialog.add_action_callback("init_local_accounts") do |_action_context|
init_local_accounts
end
if DEV_MODE
puts('Launching Speckle Connector from http://localhost:8081')
@dialog.set_url("http://localhost:8081")
else
html_file = File.join(File.dirname(File.expand_path(__FILE__)), "html", "index.html")
puts("Launching Speckle Connector from #{html_file}")
@dialog.set_file(html_file)
end
@dialog.show
@dialog
end
end
def self.send_selection(stream_id)
model = Sketchup.active_model
converter = ConverterSketchup.new(UNITS[model.options["UnitsOptions"]["LengthUnit"]])
converted = model.selection.map { |entity| converter.convert_to_speckle(entity) }
puts("converted #{converted.count} objects for stream #{stream_id}")
# puts(converted.to_json)
@dialog.execute_script("convertedFromSketchup('#{stream_id}',#{converted.to_json})")
rescue StandardError => e
puts(e)
@dialog.execute_script("sketchupOperationFailed('#{stream_id}')")
end
def self.receive_objects(base, stream_id)
puts("received objects from stream #{stream_id}")
model = Sketchup.active_model
converter = ConverterSketchup.new(UNITS[model.options["UnitsOptions"]["LengthUnit"]])
converter.traverse_commit_object(base)
@dialog.execute_script("finishedReceiveInSketchup('#{stream_id}')")
rescue StandardError => e
puts(e)
@dialog.execute_script("sketchupOperationFailed('#{stream_id}')")
end
def self.init_local_accounts
@dialog.execute_script("loadAccounts(#{Accounts.load_accounts.to_json}, #{Accounts.get_suuid.to_json})")
end
def self.reload_accounts
@dialog.execute_script("loadAccounts(#{Accounts.load_accounts.to_json})")
end
end
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

-27
View File
@@ -1,27 +0,0 @@
# frozen_string_literal: true
require "sketchup"
require "speckle_connector/dialog.rb"
require "speckle_connector/debug.rb"
module SpeckleSystems
module SpeckleConnector
unless file_loaded?(__FILE__)
cmd_cube = UI::Command.new("Dialog") { show_dialog }
cmd_cube.tooltip = "Launch Connector"
cmd_cube.status_bar_text = "Opens the Speckle Connector window"
cmd_cube.small_icon = "icons/s2logo.png"
cmd_cube.large_icon = "icons/s2logo.png"
menu = UI.menu("Tools")
menu.add_item(cmd_cube)
toolbar = UI::Toolbar.new("Speckle")
toolbar.add_item(cmd_cube)
toolbar.restore
file_loaded(__FILE__)
end
end
end
+39
View File
@@ -0,0 +1,39 @@
# frozen_string_literal: true
require 'sketchup'
require 'extensions'
# Speckle connector module to enable multiplayer mode ON!
module SpeckleConnector3
# Version - patched by CI
CONNECTOR_VERSION = '0.0.0'
file = __FILE__.dup
# Account for Ruby encoding bug under Windows.
file.force_encoding('UTF-8') if file.respond_to?(:force_encoding)
# Support folder should be named the same as the root .rb file.
folder_name = File.basename(file, '.*')
# Path to the root .rb file (this file).
PATH_ROOT = File.dirname(file).freeze
# Path to the support folder.
PATH = File.join(PATH_ROOT, folder_name).freeze
# Run from localhost or from build files
DEV_MODE = true
puts("Loading Speckle Connector v#{CONNECTOR_VERSION} from #{DEV_MODE ? 'dev' : 'build'}")
unless file_loaded?(__FILE__)
ex = SketchupExtension.new('Speckle SketchUp v3', File.join(PATH, 'bootstrap'))
ex.description = 'Speckle Connector for SketchUp'
ex.version = CONNECTOR_VERSION
ex.copyright = 'AEC Systems Ltd.'
ex.creator = 'Speckle Systems'
Sketchup.register_extension(ex, true)
file_loaded(__FILE__)
end
end
BIN
View File
Binary file not shown.
+37
View File
@@ -0,0 +1,37 @@
# frozen_string_literal: true
require 'sketchup'
require 'pathname'
require 'speckle_connector_3/debug'
require_relative 'src/log/log'
require_relative 'src/ui/sketchup_ui'
require_relative 'src/ui/ui_controller'
require_relative 'src/commands/menu_command_handler'
require_relative 'src/app/speckle_connector_app'
require_relative 'src/states/user_state'
require_relative 'src/states/initial_state'
require_relative 'src/commands/speckle_menu_commands'
# Speckle Connector on SketchUp to enable Multiplayer mode ON!
module SpeckleConnector3
SKETCHUP_VERSION = Sketchup.version.to_i
dir = __dir__.dup
dir.force_encoding('UTF-8') if dir.respond_to?(:force_encoding)
SPECKLE_CONNECTOR_SRC_PATH = Pathname.new(File.expand_path(dir)).cleanpath.to_s
def self.initialize_app
sketchup_ui = Ui::SketchupUi.new
ui_controller = Ui::UiController.new(sketchup_ui)
menu_commands = Commands::MenuCommandHandler.new
user_state = SpeckleConnector3::States::UserState.new({})
initial_state = SpeckleConnector3::States::InitialState.new(user_state)
app = SpeckleConnector3::App::SpeckleConnectorApp.new(menu_commands, initial_state, ui_controller)
# Add menu commands to SketchUp and Speckle application
Commands::SpeckleMenuCommands.add_initial_commands!(app)
app
end
app = initialize_app
SPECKLE_APP = app
end
+24
View File
@@ -0,0 +1,24 @@
# frozen_string_literal: true
# Speckle connector module to enable multiplayer mode ON!
module SpeckleConnector3
# from thomthom
# https://github.com/thomthom/true-bend/blob/master/src/tt_truebend/debug.rb
# @note Debug method to reload the plugin.
#
# @example
# SpeckleConnector.reload
#
# @return [Integer] Number of files reloaded.
# rubocop:disable SketchupSuggestions/FileEncoding
def self.reload
load(__FILE__)
pattern = File.join(__dir__, '**/*.rb')
# TODO: Here is a opportunity to improve reloading process.
# We can cache last edited time of the each file later to check which file need to be reloaded.
Dir.glob(pattern).each { |file| load(file) unless file.include?('bootstrap') }
.size
end
# rubocop:enable SketchupSuggestions/FileEncoding
end

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 798 B

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.
@@ -0,0 +1,98 @@
# frozen_string_literal: true
require 'JSON'
require_relative '../ext/sqlite3'
require_relative '../constants/path_constants'
require_relative '../preferences/preferences'
module SpeckleConnector3
# Accounts to communicate with models on user's account.
module Accounts
# Load accounts from user's app data.
def self.load_accounts
db_path = SPECKLE_ACCOUNTS_DB_PATH
unless File.exist?(db_path)
File.new(SPECKLE_ACCOUNTS_DB_PATH, "w")
db = Sqlite3::Database.new(SPECKLE_ACCOUNTS_DB_PATH)
Preferences.create_objects_table(db)
db.close
return []
end
db = Sqlite3::Database.new(db_path)
rows = db.exec('SELECT * FROM objects')
db.close
rows.map { |row| JSON.parse(row[1]) }
end
def self.add_account(account_id, account)
unless File.exist?(SPECKLE_ACCOUNTS_DB_PATH)
File.new(SPECKLE_ACCOUNTS_DB_PATH, "w")
db = Sqlite3::Database.new(SPECKLE_ACCOUNTS_DB_PATH)
create_objects_table(db)
db.close
end
db = Sqlite3::Database.new(SPECKLE_ACCOUNTS_DB_PATH)
account_json = JSON.generate(account)
sql_query = "INSERT OR REPLACE INTO objects (hash, content) VALUES ('#{account_id}', '#{account_json}')"
begin
db.exec(sql_query)
puts "Account with hash #{account_id} has been added/updated."
rescue StandardError => e
puts "An error occurred while adding the account: #{e}"
ensure
db.close
end
end
# Creates the 'objects' table in the database if it doesn't already exist.
# @param db [Sqlite3::Database] the SQLite3 database instance.
def self.create_objects_table(db)
db.exec <<-SQL
CREATE TABLE IF NOT EXISTS objects (
hash TEXT PRIMARY KEY,
content TEXT
);
SQL
end
def self.remove_account(account_id)
db_path = SPECKLE_ACCOUNTS_DB_PATH
unless File.exist?(db_path)
raise(
IOError,
"No Accounts db found. Please read the guide for different options for adding your account:\n
https://speckle.guide/user/manager.html#adding-accounts"
)
end
db = Sqlite3::Database.new(db_path)
begin
db.exec("DELETE FROM objects WHERE hash = '#{account_id}'")
puts "Account with hash #{account_id} has been removed."
rescue StandardError => e
puts "An error occurred: #{e}"
ensure
db.close
end
end
def self.get_account_by_id(id)
accounts = load_accounts
accounts.select { |acc| acc['id'] == id }[0]
end
# Default account on the user computer.
def self.default_account
accounts = load_accounts
accounts.select { |acc| acc['isDefault'] }[0] || accounts[0]
end
# Try to get local server account for debug/test purposes.
def self.try_get_local_server_account
accounts = load_accounts
accounts.select { |acc| acc['serverInfo']['url'].include?('localhost') }[0] || nil
end
end
end
@@ -0,0 +1,20 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../accounts/accounts'
require_relative '../load_saved_streams'
module SpeckleConnector3
module Actions
# Action to add account to local Account db.
class AddAccount < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, account_id, account)
SpeckleConnector3::Accounts.add_account(account_id, account)
js_script = "accountsBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('addAccount', js_script)
end
end
end
end
@@ -0,0 +1,21 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../accounts/accounts'
require_relative '../load_saved_streams'
module SpeckleConnector3
module Actions
# Action to initialize local accounts from database.
class GetAccounts < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
puts 'Initialisation of Speckle accounts requested by plugin'
accounts_data = SpeckleConnector3::Accounts.load_accounts
js_script = "accountsBinding.receiveResponse('#{resolve_id}', #{accounts_data.to_json})"
state.with_add_queue_js_command('getAccounts', js_script)
end
end
end
end
@@ -0,0 +1,20 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../accounts/accounts'
require_relative '../load_saved_streams'
module SpeckleConnector3
module Actions
# Action to remove account from database.
class RemoveAccount < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, account_id)
SpeckleConnector3::Accounts.remove_account(account_id)
js_script = "accountsBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('removeAccount', js_script)
end
end
end
end
+15
View File
@@ -0,0 +1,15 @@
# frozen_string_literal: true
module SpeckleConnector3
module Actions
# State changer object.
class Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @param parameters [Array] parameters that the action takes
# @return [States::State] the new updated state object
def self.update_state(_state, *_parameters)
raise NotImplementedError, 'Implement in subclass.'
end
end
end
end
@@ -0,0 +1,33 @@
# frozen_string_literal: true
require_relative 'action'
require_relative 'deactivate_diffing'
module SpeckleConnector3
module Actions
# Deactivate diffing for stream.
class ActivateDiffing < Action
def initialize(stream_id)
super()
@stream_id = stream_id
end
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def update_state(state)
state = DeactivateDiffing.update_state(state, nil, {})
puts "Diffing activated for #{@stream_id}"
speckle_entities = state.speckle_state.speckle_entities
invalid_speckle_entities = speckle_entities.select do |_id, entity|
entity.invalid_stream_ids.include?(@stream_id) && entity.sketchup_entity.is_a?(Sketchup::Face)
end
invalid_speckle_entities.each do |id, entity|
new_entity = entity.activate_diffing(@stream_id, state.sketchup_state.materials.by_id(MAT_EDIT))
speckle_entities = speckle_entities.put(id, new_entity)
end
new_speckle_state = state.speckle_state.with_speckle_entities(speckle_entities)
state.with_speckle_state(new_speckle_state)
end
end
end
end
@@ -0,0 +1,52 @@
# frozen_string_literal: true
require_relative 'action'
module SpeckleConnector3
module Actions
# Adds material to speckle state and Sketchup.
class AddMaterial < Action
def self.update_state(state, material_name:, color:, material_id:, alpha: nil)
materials = state.sketchup_state.materials
existing_material = materials.by_id(material_id)
return state if existing_material&.valid?
new_material = create_or_get_material(state.sketchup_state.sketchup_model,
material_name,
color,
material_id,
alpha: alpha)
new_materials = materials.add_material(material_id, new_material)
new_sketchup_state = state.sketchup_state.with(:@materials => new_materials)
state.with(:@sketchup_state => new_sketchup_state)
end
def self.create_or_get_material(model, material_name, color, material_id, alpha: nil)
materials = model.materials
existing_material = materials.find { |mat| mat.name == material_name }
return existing_material if existing_material&.valid?
existing_material = materials.add material_name
existing_material.set_attribute(MAT_DICTIONARY, MAT_ID, material_id.to_s)
set_hex_color(existing_material, color)
existing_material.alpha = alpha if alpha
existing_material
end
def self.set_hex_color(skp_material, hex_value)
hex_value = hex_value.to_s
col_blue, col_green, col_red = parse_hex_color(hex_value)
skp_material.color = col_red, col_green, col_blue
end
def self.parse_hex_color(hex_value)
split_values = hex_value.match(/^#([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})$/) ||
hex_value.match(/^#([a-fA-F\d])([a-fA-F\d])([a-fA-F\d])$/)
col_red = split_values[1].hex
col_green = split_values[2].hex
col_blue = split_values[3].hex
return col_blue, col_green, col_red
end
end
end
end
@@ -0,0 +1,73 @@
# frozen_string_literal: true
require_relative 'action'
require_relative 'mapped_entities_updated'
require_relative 'events/selection_event_action'
require_relative '../sketchup_model/dictionary/speckle_schema_dictionary_handler'
module SpeckleConnector3
module Actions
# Apply mappings for selected entities.
class ApplyMappings < Action
def initialize(entities_to_map, method, category, family,
family_type, level, name, is_definition)
super()
@entities_to_map = entities_to_map
@method = method
@category = category
@name = name
@family = family
@family_type = family_type
@level = level
@is_definition = is_definition
end
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
# rubocop:disable Metrics/MethodLength
def update_state(state)
sketchup_model = state.sketchup_state.sketchup_model
entities = if sketchup_model.active_path.nil?
sketchup_model.entities
else
sketchup_model.active_path.last.definition.entities
end
# Collect entities from entity ids that comes from UI as list
entities_to_map = entities.select { |e| @entities_to_map.include?(e.persistent_id.to_s) }
# Switch to definitions if all entities are component instance and UI flag shows that
if entities_to_map.all? { |e| e.is_a?(Sketchup::ComponentInstance) } && @is_definition
entities_to_map = entities_to_map.collect(&:definition).uniq
end
# Store speckle state to update with mapped entities.
speckle_state = state.speckle_state
entities_to_map.each do |entity|
name = if @name == '<Mixed>'
entity.respond_to?(:name) ? entity.name : ''
else
@name
end
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.set_attribute(entity, :category, @category)
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.set_attribute(entity, :name, name)
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.set_attribute(entity, :method, @method)
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.set_attribute(entity, :family, @family)
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.set_attribute(entity, :family_type, @family_type)
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.set_attribute(entity, :level, @level)
speckle_state = speckle_state.with_mapped_entity(entity)
end
new_state = MappedEntitiesUpdated.update_state(state.with_speckle_state(speckle_state))
Events::SelectionEventAction.update_state(new_state, { apply: true })
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
# rubocop:enable Metrics/MethodLength
end
end
end
@@ -0,0 +1,28 @@
# frozen_string_literal: true
require_relative 'add_send_model_card'
require_relative 'add_receive_model_card'
require_relative '../action'
require_relative '../../cards/send_card'
require_relative '../../cards/receive_card'
require_relative '../../filters/send/everything_filter'
require_relative '../../filters/send/selection_filter'
require_relative '../../filters/send_filters'
require_relative '../../sketchup_model/dictionary/model_card_dictionary_handler'
module SpeckleConnector3
module Actions
# Action to add send card.
class AddModel < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, data)
if data['typeDiscriminator'] == 'SenderModelCard'
Actions::AddSendModelCard.update_state(state, resolve_id, data)
else
Actions::AddReceiveModelCard.update_state(state, resolve_id, data)
end
end
end
end
end
@@ -0,0 +1,52 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../cards/send_card'
require_relative '../../cards/receive_card'
require_relative '../../filters/send/everything_filter'
require_relative '../../filters/send/selection_filter'
require_relative '../../filters/send_filters'
require_relative '../../sketchup_model/dictionary/model_card_dictionary_handler'
module SpeckleConnector3
module Actions
# Action to add receive model card.
class AddReceiveModelCard < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, data)
model_card_id = data['modelCardId']
account_id = data['accountId']
server_url = data['serverUrl']
workspace_id = data['workspaceId']
workspace_slug = data['workspaceSlug']
project_id = data['projectId']
model_id = data['modelId']
project_name = data['projectName']
model_name = data['modelName']
expired = data['expired']
selected_version_id = data['selectedVersionId']
selected_version_source_app = data['selectedVersionSourceApp']
selected_version_user_id = data['selectedVersionUserId']
latest_version_id = data['latestVersionId']
latest_version_source_app = data['latestVersionSourceApp']
latest_version_user_id = data['latestVersionUserId']
has_dismissed_update_warning = data['hasDismissedUpdateWarning']
baked_object_ids = data['bakedObjectIds'].nil? ? nil : data['bakedObjectIds'].values
receive_card = Cards::ReceiveCard.new(model_card_id, account_id, server_url, workspace_id, workspace_slug,
project_id, model_id,
project_name, model_name,
selected_version_id, selected_version_source_app, selected_version_user_id,
latest_version_id, latest_version_source_app, latest_version_user_id,
has_dismissed_update_warning, expired, baked_object_ids)
SketchupModel::Dictionary::ModelCardDictionaryHandler
.save_receive_card_to_model(receive_card, state.sketchup_state.sketchup_model)
new_speckle_state = state.speckle_state.with_receive_card(receive_card)
state = state.with_speckle_state(new_speckle_state)
js_script = "baseBinding.receiveResponse('#{resolve_id}')"
return state.with_add_queue_js_command('addReceiveCard', js_script)
end
end
end
end
@@ -0,0 +1,48 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../cards/send_card'
require_relative '../../cards/receive_card'
require_relative '../../filters/send/everything_filter'
require_relative '../../filters/send/selection_filter'
require_relative '../../filters/send_filters'
require_relative '../../settings/card_settings'
require_relative '../../sketchup_model/dictionary/model_card_dictionary_handler'
module SpeckleConnector3
module Actions
# Action to add send model card.
class AddSendModelCard < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, data)
send_filter = Filters::SendFilters.get_filter_from_ui_data(data['sendFilter'])
# settings = Settings::CardSetting.get_setting_from_ui_data(data['settings'])
# Init card and add to the state
send_card = Cards::SendCard.new(
data['modelCardId'],
data['accountId'],
data['serverUrl'],
data['workspaceId'],
data['workspaceSlug'],
data['projectId'],
data['projectName'],
data['modelId'],
data['modelName'],
data['latestCreatedVersionId'],
send_filter,
data['settings']
)
SketchupModel::Dictionary::ModelCardDictionaryHandler
.save_send_card_to_model(send_card, state.sketchup_state.sketchup_model)
new_speckle_state = state.speckle_state.with_send_card(send_card)
state = state.with_speckle_state(new_speckle_state)
# Resolve promise
js_script = "baseBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('addSendCard', js_script)
end
end
end
end
@@ -0,0 +1,17 @@
# frozen_string_literal: true
require_relative '../action'
module SpeckleConnector3
module Actions
# Get connector version.
class GetConnectorVersion < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
js_command = "baseBinding.receiveResponse('#{resolve_id}', '#{CONNECTOR_VERSION}')"
state.with_add_queue_js_command('getConnectorVersion', js_command)
end
end
end
end
@@ -0,0 +1,97 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../filters/send_filters'
require_relative '../../sketchup_model/dictionary/model_card_dictionary_handler'
module SpeckleConnector3
module Actions
# Gets document state.
class GetDocumentState < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
send_cards_hash = SketchupModel::Dictionary::ModelCardDictionaryHandler
.get_send_cards_from_dict(state.sketchup_state.sketchup_model)
# TODO: CONVERTER_V2: Extract into new actions
send_cards = send_cards_hash.collect do |id, card|
filter = Filters::SendFilters.get_filter_from_document(card['sendFilter'])
settings = Settings::CardSetting.get_filter_from_document(card['sendSettings'])
send_card = Cards::SendCard.new(
id,
card['account_id'],
card['server_url'],
card['workspace_id'],
card['workspace_slug'],
card['project_id'],
card['project_name'],
card['model_id'],
card['model_name'],
card['latest_created_version_id'],
filter,
settings
)
new_speckle_state = state.speckle_state.with_send_card(send_card)
state = state.with_speckle_state(new_speckle_state)
{
modelCardId: send_card.model_card_id,
accountId: send_card.account_id,
serverUrl: send_card.server_url,
workspaceId: send_card.workspace_id,
workspaceSlug: send_card.workspace_slug,
projectId: send_card.project_id,
modelId: send_card.model_id,
sendFilter: send_card.send_filter,
settings: send_card.send_settings,
latestCreatedVersionId: send_card.latest_created_version_id,
typeDiscriminator: send_card.type_discriminator
}
end
receive_cards_hash = SketchupModel::Dictionary::ModelCardDictionaryHandler
.get_receive_cards_from_dict(state.sketchup_state.sketchup_model)
# TODO: CONVERTER_V2: Extract into new actions
receive_cards = receive_cards_hash.collect do |id, card|
receive_card = Cards::ReceiveCard.new(id, card['account_id'], card['server_url'], card['workspace_id'], card['workspace_slug'], card['project_id'], card['model_id'],
card['project_name'], card['model_name'], card['selected_version_id'],
card['selected_version_source_app'], card['selected_version_user_id'],
card['latest_version_id'], card['latest_version_source_app'],
card['latest_version_user_id'], card['has_dismissed_update_warning'],
card['expired'], card['baked_object_ids'])
new_speckle_state = state.speckle_state.with_receive_card(receive_card)
state = state.with_speckle_state(new_speckle_state)
{
modelCardId: receive_card.model_card_id,
accountId: receive_card.account_id,
serverUrl: receive_card.server_url,
workspaceId: receive_card.workspace_id,
workspaceSlug: receive_card.workspace_slug,
projectId: receive_card.project_id,
modelId: receive_card.model_id,
projectName: receive_card.project_name,
modelName: receive_card.model_name,
selectedVersionId: receive_card.selected_version_id,
selectedVersionSourceApp: receive_card.selected_version_source_app,
selectedVersionUserId: receive_card.selected_version_user_id,
latestVersionId: receive_card.latest_version_id,
latestVersionSourceApp: receive_card.latest_version_source_app,
latestVersionUserId: receive_card.latest_version_user_id,
hasDismissedUpdateWarning: receive_card.has_dismissed_update_warning,
expired: receive_card.expired,
bakedObjectIds: receive_card.baked_object_ids,
typeDiscriminator: receive_card.type_discriminator
}
end
model_state = { models: send_cards + receive_cards }
js_script = "baseBinding.receiveResponse('#{resolve_id}', #{model_state.to_json})"
state.with_add_queue_js_command('getDocumentState', js_script)
end
end
end
end
@@ -0,0 +1,19 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../filters/send_filters'
module SpeckleConnector3
module Actions
# Action to get send filter.
class GetSendFilters < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
default_filters = Filters::SendFilters.get_default(state.sketchup_state.sketchup_model)
js_script = "sendBinding.receiveResponse('#{resolve_id}', #{default_filters.to_json})"
state.with_add_queue_js_command('getSendFilter', js_script)
end
end
end
end
@@ -0,0 +1,24 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../settings/card_settings'
module SpeckleConnector3
module Actions
# Action to get send settings.
class GetSendSettings < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
# NOTE: below code is tested and works!
# default_settings = [
# Settings::CardSetting.new(id: "includeAttributes", title: "Include Attributes", type: "boolean", value: true),
# Settings::CardSetting.new(id: "test", title: "Test", type: "string", value: "a", enum: %w[a b c])
# ]
default_settings = []
js_script = "sendBinding.receiveResponse('#{resolve_id}', #{default_settings.to_json})"
state.with_add_queue_js_command('getSendSettings', js_script)
end
end
end
end
@@ -0,0 +1,17 @@
# frozen_string_literal: true
require_relative '../action'
module SpeckleConnector3
module Actions
# Get source app name.
class GetSourceAppName < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
js_command = "baseBinding.receiveResponse('#{resolve_id}', 'sketchup')"
state.with_add_queue_js_command('getSourceAppName', js_command)
end
end
end
end
@@ -0,0 +1,17 @@
# frozen_string_literal: true
require_relative '../action'
module SpeckleConnector3
module Actions
# Get source app version.
class GetSourceAppVersion < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
js_command = "baseBinding.receiveResponse('#{resolve_id}', #{SKETCHUP_VERSION})"
state.with_add_queue_js_command('getSourceAppVersion', js_command)
end
end
end
end
@@ -0,0 +1,31 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../sketchup_model/query/entity'
module SpeckleConnector3
module Actions
# Action to add send card.
class HighlightModel < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, model_card_id)
receiver_card = state.speckle_state.receive_cards[model_card_id]
sender_card = state.speckle_state.send_cards[model_card_id]
card = receiver_card || sender_card
objects_to_highlight = if card.type_discriminator == 'ReceiverModelCard'
state.speckle_state.receive_cards[model_card_id].baked_object_ids
else
state.speckle_state.send_cards[model_card_id].send_filter.selected_object_ids
end
SketchupModel::Utils::ViewUtils.highlight_entities(state.sketchup_state.sketchup_model, objects_to_highlight)
# Resolve promise
js_script = "baseBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('highlightModel', js_script)
end
end
end
end
@@ -0,0 +1,20 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../sketchup_model/query/entity'
require_relative '../../sketchup_model/utils/view_utils'
module SpeckleConnector3
module Actions
# Action to add send card.
class HighlightObjects < Action
def self.update_state(state, resolve_id, object_ids)
SketchupModel::Utils::ViewUtils.highlight_entities(state.sketchup_state.sketchup_model, object_ids)
# Resolve promise
js_script = "baseBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('highlightObjects', js_script)
end
end
end
end
@@ -0,0 +1,31 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../cards/send_card'
require_relative '../../cards/receive_card'
require_relative '../../filters/send/everything_filter'
require_relative '../../filters/send/selection_filter'
require_relative '../../filters/send_filters'
require_relative '../../sketchup_model/dictionary/model_card_dictionary_handler'
module SpeckleConnector3
module Actions
# Action to remove send card.
class RemoveModel < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, data)
SketchupModel::Dictionary::ModelCardDictionaryHandler.remove_card_dict(state.sketchup_state.sketchup_model, data)
new_speckle_state = if data['typeDiscriminator'] == 'ReceiverModelCard'
state.speckle_state.without_receive_card(data['id'])
else
state.speckle_state.without_send_card(data['id'])
end
state = state.with_speckle_state(new_speckle_state)
# Resolve promise
js_script = "baseBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('removeModel', js_script)
end
end
end
end
@@ -0,0 +1,34 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../cards/send_card'
require_relative '../../cards/receive_card'
require_relative '../../filters/send/everything_filter'
require_relative '../../filters/send/selection_filter'
require_relative '../../filters/send_filters'
require_relative '../../sketchup_model/dictionary/model_card_dictionary_handler'
module SpeckleConnector3
module Actions
# Action to remove cards.
class RemoveModels < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, data)
data.each do |model_card|
SketchupModel::Dictionary::ModelCardDictionaryHandler.remove_card_dict(state.sketchup_state.sketchup_model, model_card)
new_speckle_state = if model_card['typeDiscriminator'] == 'ReceiverModelCard'
state.speckle_state.without_receive_card(model_card['id'])
else
state.speckle_state.without_send_card(model_card['id'])
end
state = state.with_speckle_state(new_speckle_state)
end
# Resolve promise
js_script = "baseBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('removeModels', js_script)
end
end
end
end
@@ -0,0 +1,20 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../sketchup_model/dictionary/model_card_dictionary_handler'
module SpeckleConnector3
module Actions
# Action to update send filter.
class UpdateSendFilter < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, data, value)
SketchupModel::Dictionary::ModelCardDictionaryHandler.update_filter(state.sketchup_state.sketchup_model, data, value)
js_script = "sendBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('updateSendFilter', js_script)
end
end
end
end
@@ -0,0 +1,31 @@
# frozen_string_literal: true
require_relative 'action'
require_relative '../sketchup_model/dictionary/speckle_entity_dictionary_handler'
module SpeckleConnector3
module Actions
# Clear mapper source.
class ClearMapperSource < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, _resolve_id, _data)
new_speckle_state = state.speckle_state.with_removed_mapper_source
erase_levels(state)
state.with_speckle_state(new_speckle_state)
end
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
def self.erase_levels(state)
levels = state.sketchup_state.sketchup_model.definitions.select do |definition|
SketchupModel::Dictionary::SpeckleEntityDictionaryHandler.get_attribute(definition, :speckle_type) ==
OBJECTS_BUILTELEMENTS_REVIT_LEVEL
end
levels.each do |level|
level.entities.clear!
level.instances.each(&:erase!)
end
end
end
end
end
@@ -0,0 +1,52 @@
# frozen_string_literal: true
require_relative 'action'
require_relative 'mapped_entities_updated'
require_relative 'events/selection_event_action'
require_relative '../sketchup_model/dictionary/speckle_schema_dictionary_handler'
module SpeckleConnector3
module Actions
# Clear mappings for selected entities.
class ClearMappings < Action
def initialize(entities_to_map, is_definition)
super()
@entities_to_map = entities_to_map
@is_definition = is_definition
end
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def update_state(state)
sketchup_model = state.sketchup_state.sketchup_model
entities = if sketchup_model.active_path.nil?
sketchup_model.entities
else
sketchup_model.active_path.last.definition.entities
end
# Collect entities from entity ids that comes from UI as list
entities_to_map = entities.select { |e| @entities_to_map.include?(e.persistent_id.to_s) }
# Switch to definitions if all entities are component instance and UI flag shows that
if entities_to_map.all? { |e| e.is_a?(Sketchup::ComponentInstance) } && @is_definition
entities_to_map = entities_to_map.collect(&:definition).uniq
end
# Store speckle state to update with mapped entities.
speckle_state = state.speckle_state
entities_to_map.each do |entity|
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.remove_dictionary(entity)
speckle_state = speckle_state.with_removed_mapped_entity(entity)
end
new_state = MappedEntitiesUpdated.update_state(state.with_speckle_state(speckle_state))
Events::SelectionEventAction.update_state(new_state, { clear: true })
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity
end
end
end
@@ -0,0 +1,34 @@
# frozen_string_literal: true
require_relative 'action'
require_relative 'mapped_entities_updated'
require_relative 'events/selection_event_action'
require_relative '../sketchup_model/dictionary/speckle_schema_dictionary_handler'
module SpeckleConnector3
module Actions
# Clear mappings for selected entities from mapped elements table.
class ClearMappingsFromTable < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, _resolve_id, data)
# Flat entities to clear mappings
flat_entities = SketchupModel::Query::Entity.flat_entities(state.sketchup_state.sketchup_model.entities)
# Collect entity ids to clear mappings
entity_ids = data.collect { |_, entities| entities['selectedElements'].collect { |e| e['entityId'] } }.flatten
# Store speckle state to update with mapped entities.
speckle_state = state.speckle_state
flat_entities.each do |entity|
next unless entity_ids.include?(entity.persistent_id.to_s)
SketchupModel::Dictionary::SpeckleSchemaDictionaryHandler.remove_dictionary(entity)
speckle_state = speckle_state.with_removed_mapped_entity(entity)
end
new_state = MappedEntitiesUpdated.update_state(state.with_speckle_state(speckle_state))
Events::SelectionEventAction.update_state(new_state, { clear: true })
end
end
end
end
@@ -0,0 +1,17 @@
# frozen_string_literal: true
require_relative 'action'
module SpeckleConnector3
module Actions
# Clear queue from state.
class ClearQueue < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state)
new_speckle_state = state.speckle_state.with(:@message_queue => {})
state.with(:@speckle_state => new_speckle_state)
end
end
end
end
@@ -0,0 +1,18 @@
# frozen_string_literal: true
require_relative 'action'
require_relative '../ext/sqlite3'
require_relative '../constants/path_constants'
module SpeckleConnector3
module Actions
# Action to collect preferences from database to UI.
class CollectPreferences < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, _resolve_id, _data)
state.with_add_queue('collectPreferences', state.user_state.preferences.to_json, [])
end
end
end
end
@@ -0,0 +1,20 @@
# frozen_string_literal: true
require_relative 'action'
module SpeckleConnector3
module Actions
# Action to collect versions from sketchup and connector to track user's version by mixpanel.
class CollectVersions < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, _resolve_id, _data)
versions = {
sketchup: Sketchup.version.to_i,
speckle: SpeckleConnector3::CONNECTOR_VERSION
}
state.with_add_queue('collectVersions', versions.to_json, [])
end
end
end
end
@@ -0,0 +1,22 @@
# frozen_string_literal: true
require_relative '../action'
module SpeckleConnector3
module Actions
# Action to get config.
class GetConfig < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
# Previously it was stored in user state
# config = state.user_state.preferences.to_json
config = {
darkTheme: state.user_state.user_preferences[:dark_theme]
}
js_script = "configBinding.receiveResponse('#{resolve_id}', #{config.to_json})"
state.with_add_queue_js_command('getConfig', js_script)
end
end
end
end
@@ -0,0 +1,17 @@
# frozen_string_literal: true
require_relative '../action'
module SpeckleConnector3
module Actions
# Action to get is dev mode.
class GetIsDevMode < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
js_script = "configBinding.receiveResponse('#{resolve_id}', #{DEV_MODE})"
state.with_add_queue_js_command('getIsDevMode', js_script)
end
end
end
end
@@ -0,0 +1,21 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../preferences/preferences'
module SpeckleConnector3
module Actions
class GetUserSelectedAccountId < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id)
user_selected_account_id = Preferences.get_user_selected_account_id
accountsConfig = {
userSelectedAccountId: user_selected_account_id
}
js_script = "configBinding.receiveResponse('#{resolve_id}', #{accountsConfig.to_json})"
state.with_add_queue_js_command('getUserSelectedAccountId', js_script)
end
end
end
end
@@ -0,0 +1,18 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../../preferences/preferences'
module SpeckleConnector3
module Actions
class SetUserSelectedAccountId < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, account_id)
Preferences.set_user_selected_account_id(account_id)
js_script = "configBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('setUserSelectedAccountId', js_script)
end
end
end
end
@@ -0,0 +1,26 @@
# frozen_string_literal: true
require_relative '../action'
require_relative '../user_preferences_updated'
module SpeckleConnector3
module Actions
# Action to update config.
class UpdateConfig < Action
KEY_VALUES = {
'darkTheme' => 'dark_theme'
}.freeze
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, resolve_id, config)
config.each do |key, value|
state = Actions::UserPreferencesUpdated.new('Sketchup', KEY_VALUES[key], value).update_state(state)
end
js_script = "configBinding.receiveResponse('#{resolve_id}')"
state.with_add_queue_js_command('updateConfig', js_script)
end
end
end
end
@@ -0,0 +1,15 @@
# frozen_string_literal: true
module SpeckleConnector3
module Actions
# Action to update connected state of application.
class Connected < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state)
puts 'Speckle connected!'
state.with(:@connected => true)
end
end
end
end
@@ -0,0 +1,66 @@
# frozen_string_literal: true
require_relative 'action'
require_relative '../accounts/accounts'
require_relative '../actions/save_stream'
require_relative '../actions/queue_send'
require_relative '../convertors/converter'
module SpeckleConnector3
module Actions
# Create stream.
class CreateStream < Action
def initialize(stream_name: nil)
super()
@stream_name = stream_name
end
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
# rubocop:disable Metrics/MethodLength
def update_state(state)
puts 'send to speckle'
acct = Accounts.default_account
if acct.nil?
puts 'No local account found. Please refer to speckle.guide for more information.'
return state
end
sketchup_model = state.sketchup_state.sketchup_model
path = sketchup_model.path
if @stream_name.nil?
@stream_name = path ? File.basename(path, '.*') : 'Untitled SketchUp Model'
end
query = 'mutation streamCreate($stream: StreamCreateInput!) {streamCreate(stream: $stream)}'
vars = { stream: { name: @stream_name, description: 'Stream created from SketchUp' } }
request = Sketchup::Http::Request.new("#{acct['serverInfo']['url']}/graphql", Sketchup::Http::POST)
request.headers = { 'Authorization' => "Bearer #{acct['token']}", 'Content-Type' => 'application/json' }
request.body = { query: query, variables: vars }.to_json
to_convert = if sketchup_model.selection.count > 0
sketchup_model.selection
else
sketchup_model.entities
end
state = evaluate_request(sketchup_model, request, state, to_convert)
Actions::LoadSavedStreams.update_state(state, {})
end
# rubocop:enable Metrics/MethodLength
private
def evaluate_request(sketchup_model, request, state, to_convert)
converter = Converters::Converter.new(sketchup_model)
request.start do |_req, res|
res_data = JSON.parse(res.body)['data']
raise(StandardError) unless res_data
stream_id = res_data['streamCreate']
state = Actions::SaveStream.new(stream_id).update_state(state)
converted = to_convert.map { |entity| converter.convert_to_speckle(entity) }
state = Actions::QueueSend.new(stream_id, converted).update_state(state)
end
state
end
end
end
end
@@ -0,0 +1,26 @@
# frozen_string_literal: true
require_relative 'action'
module SpeckleConnector3
module Actions
# Deactivate diffing.
class DeactivateDiffing < Action
# @param state [States::State] the current state of the {App::SpeckleConnectorApp}
# @return [States::State] the new updated state object
def self.update_state(state, _resolve_id, _data)
puts 'Diffing deactivated!'
speckle_entities = state.speckle_state.speckle_entities
diffing_activated_speckle_entities = speckle_entities.reject do |_id, entity|
entity.active_diffing_stream_id.nil?
end
diffing_activated_speckle_entities.each do |id, entity|
new_entity = entity.deactivate_diffing
speckle_entities = speckle_entities.put(id, new_entity)
end
new_speckle_state = state.speckle_state.with_speckle_entities(speckle_entities)
state.with_speckle_state(new_speckle_state)
end
end
end
end
@@ -0,0 +1,58 @@
# frozen_string_literal: true
require_relative 'event_action'
require_relative 'on_document_changed'
require_relative '../load_sketchup_model'
require_relative '../collect_preferences'
module SpeckleConnector3
module Actions
module Events
# Handle events that are triggered by the {AppObserver}.
class AppEventAction < EventAction
# Handle loading new or existing model
class OnNewOrChangedModel
# Handle events when the new or existing model is loaded in Sketchup
# @param state [States::State] the current state of speckle application
# @param event_data [Array<(Sketchup::Model)>] the event data for the given event. It consists of
# a double array with a single element that is the {Sketchup::Model} object of the loaded model.
def self.update_state(state, event_data)
return state unless event_data&.any?
model = event_data.flatten.first
# LoadSketchupModel action should be responsible to update all model specific data for state and then
# should notify the UI to update it's components.
new_state = Actions::LoadSketchupModel.update_state(state, model)
# Action to let UI to render itself with new preferences state
# TODO: Later UI should be updated if any stream is invalid after
# we collected speckle_entities appropriately
new_state = CollectPreferences.update_state(new_state, nil, {})
OnDocumentChanged.update_state(new_state)
end
end
# Run actions that are needed before the sketchup quits
class OnQuit
# Handle when Sketchup application closes
# @param state [States::State] the current state of speckle application
# @param _event_data [Array] the event data
# @return [States::State] the transformed state object
def self.update_state(state, _event_data)
state
end
end
# Handlers that are used to handle specific events
ACTIONS = {
onNewModel: OnNewOrChangedModel,
onOpenModel: OnNewOrChangedModel,
onQuit: OnQuit
}.freeze
def self.actions
ACTIONS
end
end
end
end
end
@@ -0,0 +1,161 @@
# frozen_string_literal: true
require_relative 'event_action'
require_relative '../../actions/send_actions/send_card_expiration_check'
require_relative '../../sketchup_model/utils/face_utils'
require_relative '../../constants/dict_constants'
require_relative '../../sketchup_model/query/path'
module SpeckleConnector3
module Actions
module Events
# Event actions related to entities.
class EntitiesEventAction < EventAction
PATH = SketchupModel::Query::Path
# Event action when element added.
class OnElementAdded
# @param state [States::State] the current state of the SpeckleConnector Application
def self.update_state(state, event_data)
modified_entities = event_data.to_a.collect { |e| e[1] }
# do not copy speckle base object specific attributes, because they are entity specific
modified_entities.each { |entity| entity.delete_attribute(SPECKLE_BASE_OBJECT) }
# All parent ids on current active path
parent_ids = PATH.parents_with_definitions(state.sketchup_state.sketchup_model).collect(&:persistent_id).collect(&:to_s)
# All instances that changed potentially because of potential definition update
path_instance_ids = PATH.instances(state.sketchup_state.sketchup_model).collect(&:persistent_id).collect(&:to_s)
wrapped_entity_ids = wrapped_entity_ids(modified_entities)
ids_to_check = parent_ids + wrapped_entity_ids + path_instance_ids +
modified_entities.collect(&:persistent_id).collect(&:to_s) # NOTE: It fixes the same weird face problems. Ideally the push-pull result should hit the OnElementModified but for some cases we found the edge here......
state = EntitiesEventAction.run_expiration_checks(state, ids_to_check) if ids_to_check.any?
attach_edge_entity_observer(modified_entities.grep(Sketchup::Edge), state.speckle_state.observers[ENTITY_OBSERVER])
state
end
def self.wrapped_entity_ids(modified_entities)
wrapped_entity_ids = []
modified_entities.select { |e| e.respond_to?(:definition) }.each do |c|
wrapped_entity_ids += c.definition.entities.collect(&:persistent_id).collect(&:to_s)
end
wrapped_entity_ids
end
# It is needed for attaching EntityObserver to newly added edges to track them with a hacky way.
# This hacky way is because of limitation on Sketchup API that observer cannot catch changes on Edges
# with EntitiesObserver.
def self.attach_edge_entity_observer(edges, observer)
edges.each do |edge|
edge.add_observer(observer)
edge.start.add_observer(observer)
edge.end.add_observer(observer)
end
end
end
# Event action when element modified.
class OnElementModified
# @param state [States::State] the current state of the SpeckleConnector Application
def self.update_state(state, event_data)
modified_entities = event_data.collect { |data| data[1] }.to_a
definition_faces = get_definition_faces(modified_entities)
near_faces = get_near_faces(modified_entities)
modified_persistent_ids = modified_entities.collect(&:persistent_id).collect(&:to_s) +
definition_faces.collect(&:persistent_id).collect(&:to_s) +
near_faces.collect(&:persistent_id).collect(&:to_s)
parent_ids = PATH.parents_with_definitions(state.sketchup_state.sketchup_model).collect(&:persistent_id).collect(&:to_s)
path_instance_ids = PATH.instances(state.sketchup_state.sketchup_model).collect(&:persistent_id).collect(&:to_s)
modified_persistent_ids += parent_ids + path_instance_ids
state = EntitiesEventAction.run_expiration_checks(state, modified_persistent_ids)
# if modified_entity.is_a?(Sketchup::Face)
# path = state.sketchup_state.sketchup_model.active_path
# modified_faces = SketchupModel::Utils::FaceUtils.near_faces(modified_entity.edges)
# path_objects = path.nil? ? [] : path + path.collect(&:definition)
# parent_ids = path_objects.collect(&:persistent_id).collect(&:to_s)
# ids_to_invalidate = modified_faces.collect(&:persistent_id).collect(&:to_s) + parent_ids
# entities_to_invalidate = speckle_entities_to_invalidate(speckle_state, ids_to_invalidate)
# new_speckle_state = invalidate_speckle_entities(speckle_state, entities_to_invalidate)
# # This is the place we can send information to UI for diffing check
# diffing = state.user_state.preferences[:user][:diffing]
# new_speckle_state = new_speckle_state.with_invalid_streams_queue if diffing
# return state.with_speckle_state(new_speckle_state)
# end
state
end
def self.get_near_faces(modified_entities)
near_faces = []
modified_entities.each do |modified_entity|
if modified_entity.is_a?(Sketchup::Face)
near_faces += SketchupModel::Utils::FaceUtils.near_faces(modified_entity.edges)
elsif modified_entity.is_a?(Sketchup::Edge)
near_faces += modified_entity.faces
end
end
near_faces
end
def self.get_definition_faces(modified_entities)
definition_faces = []
modified_entities.each do |modified_entity|
next unless modified_entity.is_a?(Sketchup::Face)
next unless modified_entity.parent.is_a?(Sketchup::ComponentDefinition)
definition_faces += modified_entity.parent.entities.grep(Sketchup::Face)
end
definition_faces
end
# @param speckle_state [States::SpeckleState] the current state of the Speckle
def self.speckle_entities_to_invalidate(speckle_state, ids)
speckle_state.speckle_entities.to_h.select { |id, _| ids.include?(id) }
end
# @param speckle_state [States::SpeckleState] the current state of the Speckle
def self.invalidate_speckle_entities(speckle_state, entities_to_invalidate)
speckle_entities = speckle_state.speckle_entities
entities_to_invalidate.each do |id, speckle_entity|
edited_speckle_entity = speckle_entity.with_invalid
speckle_entities = speckle_entities.put(id, edited_speckle_entity)
end
speckle_state.with_speckle_entities(speckle_entities)
end
end
# Event action when element removed.
class OnElementRemoved
# @param state [States::State] the current state of the SpeckleConnector Application
def self.update_state(state, event_data)
modified_entity_ids = event_data.collect { |data| data[1] }.to_a.collect(&:to_s)
new_speckle_state = state.speckle_state.with_changed_entity_ids(modified_entity_ids)
state = state.with_speckle_state(new_speckle_state)
Actions::SendCardExpirationCheck.update_state(state)
end
end
# @param state [States::State] the current state of the SpeckleConnector Application
# @param changed_persistent_ids [Array<String>] list of changed persistent ids
def self.run_expiration_checks(state, changed_persistent_ids)
new_speckle_state = state.speckle_state.with_changed_entity_persistent_ids(changed_persistent_ids)
state = state.with_speckle_state(new_speckle_state)
Actions::SendCardExpirationCheck.update_state(state)
end
# Handlers that are used to handle specific events
ACTIONS = {
onElementRemoved: OnElementRemoved,
onElementAdded: OnElementAdded,
onElementModified: OnElementModified
}.freeze
def self.actions
ACTIONS
end
end
end
end
end
@@ -0,0 +1,51 @@
# frozen_string_literal: true
require_relative 'event_action'
require_relative '../../constants/dict_constants'
require_relative '../../sketchup_model/query/path'
module SpeckleConnector3
module Actions
module Events
PATH = SketchupModel::Query::Path
# Event actions related to entities.
class EntityEventAction < EventAction
# Event action when entity modified/changed.
# PS: this handler action only triggers for edges and it's vertices since we attach EntityObserver to
# only edge and vertex entities. This is a limitation of the Sketchup API that can't handles edges with
# EntitiesObserver.
class OnChangeEntity
# @param state [States::State] the current state of the SpeckleConnector Application
def self.update_state(state, event_data)
edges = []
event_data.each do |event_d|
event_d.each do |d|
next if d.deleted?
edges.append(d) if d.is_a?(Sketchup::Edge)
edges += d.edges if d.is_a?(Sketchup::Vertex) && d.edges
end
end
parent_ids = PATH.parents_with_definitions(state.sketchup_state.sketchup_model).collect(&:persistent_id).collect(&:to_s)
path_instance_ids = PATH.instances(state.sketchup_state.sketchup_model).collect(&:persistent_id).collect(&:to_s)
edges.uniq!
edge_ids = edges.collect(&:persistent_id).collect(&:to_s)
new_speckle_state = state.speckle_state.with_changed_entity_persistent_ids(edge_ids + parent_ids + path_instance_ids)
state.with_speckle_state(new_speckle_state)
end
end
# Handlers that are used to handle specific events
ACTIONS = {
onChangeEntity: OnChangeEntity
}.freeze
def self.actions
ACTIONS
end
end
end
end
end
@@ -0,0 +1,34 @@
# frozen_string_literal: true
module SpeckleConnector3
module Actions
# This module contains actions that are performed to handle events triggered by observers in Sketchup.
module Events
# Base action for Handling events
class EventAction
def self.actions
raise NoMethodError, 'Implement in a subclass'
end
# Handle the events that were collected by the observer. In case of the selection observer,
# we only need to handle the events once if any of the events actually happened.
# @param state [States::State] the current state of the SpeckleConnector Application
# @param events [Hash{Symbol=>Array}] the event data grouped by the event name
# @return [States::State] the transformed state
def self.update_state(state, events)
# Don't do anything if there are no events for this action
return state unless events
actions = self.actions
actions.each do |event_name, action|
next unless events.key?(event_name)
event_data = events[event_name]
state = action.update_state(state, event_data)
end
state
end
end
end
end
end

Some files were not shown because too many files have changed in this diff Show More