specklesystems / speckle-unity

AEC Interoperability for Unity through Speckle
https://speckle.systems/tag/unity/
Apache License 2.0
55 stars 20 forks source link

added assemblies in preparation for creating a Package #7 #39

Closed psarras closed 3 years ago

psarras commented 3 years ago

This would be required before creating a package for unity. Essentially it breaks scripts down into different assemblies and you reference any dependencies. It will speed up builds on newer version of unity as well.

To create a package there would be a need for a bit of refactoring on the structure so I was a bit hesitant to do it with a PR pending.

haitheredavid commented 3 years ago

@psarras totally agree with you on this setup! Ideally I think this connector needs to accessible through OpenUPM or something similar which would require this type of setup. And I think it's best to start this structure sooner than later 👍🏻

The one part that I haven't really wrapped my head around fully yet is how to best integrate Object Kits into this type of structure. I have a similar setup to yours in a separate fork where I am referencing the Objects.dll along with a separate custom kit I've been building. Do we create a separate assembly ref for any objects, kits, and their converters? Or does it make more sense to have everything dropped into assembly ref and let the user have full control of the project hierarchy ?... 🤔

psarras commented 3 years ago

Hey @haitheredavid I haven't really played a lot with it yet. Is you plan to use it on the Web or as a standalone app?

haitheredavid commented 3 years ago

@psarras for now I'm thinking that standalone and mobile would be the targets. tbh I don't have much experience with unity web builds so I don't know the in's and out's of those types of builds... but I sorta figure that unless there is specific use case needed for a unity web version I would think that using speckles viewer / front end would be a better experience.

psarras commented 3 years ago

@psarras totally agree with you on this setup! Ideally I think this connector needs to accessible through OpenUPM or something similar which would require this type of setup. And I think it's best to start this structure sooner than later

Yes exactly. I would have liked to have this right now, so that I can easily separate Speckle with App code

haitheredavid commented 3 years ago

To get this package on OpenUPM would take a lil bit of prep to the repo and project, but overall it wouldn't be too much work. I'll try to push this out sooner than later, but for now you could try exporting the unity project as a package and trying to load from there. I would double check that Objects.dll matches up with whatever version you have on your other connectors (another pain of unity, might have to add some sort of assembly checker tool 🙄 )

JR-Morgan commented 3 years ago

I'm getting an assembly reference error in Speckle.Connector.Editor.asmdef

Looks like the Speckle.Connector.asmdef.meta file was not pushed so Unity is generating a different GUID for it.

JR-Morgan commented 3 years ago

I found the culprit, .meta files are being ignored https://github.com/psarras/speckle-unity/blame/assemblies/.gitignore#L76 @haitheredavid, I'm pretty sure this is the cause of the endless scene references breakages.

Removing that line in the .gitignore, and fixing any broken references should be all that's needed.

haitheredavid commented 3 years ago

@JR-Morgan good looks! This will be needed for openUPM stuff too!

JR-Morgan commented 3 years ago

Ok, what I will do then @psarras is merge this branch into a temporary branch where I can fix the .meta file stuff, then I will merge to main.