Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
305 commits
Select commit Hold shift + click to select a range
21068e2
Allow non-runtime gltf export without needing to disable our plugin
andybak May 30, 2024
16c7e3c
Add the scene metadata needed for gltf files to recreate lights
andybak Jun 2, 2024
a60ede9
WIP implementation of sketchbook and poly panel API integration
andybak Jun 10, 2024
3d8fb2f
Create cameras and animation clips for GLTF export (WIP)
andybak Jun 15, 2024
0ad431e
Switch to official UnityGLTF repo
andybak Jun 17, 2024
9e11bf9
Update UnityGLTFSettings.asset
andybak Jun 17, 2024
c0aa661
Move GLTF export standin handling to prefab. Stub out sky export logic
andybak Jun 17, 2024
55c03ce
Missing user config entry
andybak Jun 17, 2024
d0c39b3
Unused import
andybak Jun 17, 2024
4ec1567
Move camera path export logic to the export plugin
andybak Jun 18, 2024
28abbd1
"Camera Path" mode for the spectator cam. (via HTTP API only for now)
andybak Jun 20, 2024
d65cdac
ShouldNodeExport method (needs custom fork of UnityGLTF)
andybak Jun 20, 2024
e5c46a8
Set alphamode and doublesided based on brush manifest.
andybak Jun 30, 2024
09bd471
switch to our fork of UnityGLTF
andybak Jun 30, 2024
6c7f2bc
Bool check was inverted
andybak Jun 30, 2024
69ce46a
Give ConcaveHull it's own copy of the MatteHull material to ease matc…
andybak Jun 30, 2024
194fe2a
manifest and alpha mode logic for new GLTF export
andybak Jun 30, 2024
f7233f6
Can't exclude BaseBrushScript gameobjects if we want to support unbat…
andybak Jun 30, 2024
b2f54b0
API Brush json was included invalid brushes and name matching was buggy
andybak Jul 1, 2024
a1419c3
Revert "Give ConcaveHull it's own copy of the MatteHull material to e…
andybak Jul 1, 2024
8fb9df3
Merge branch 'main' into feature/icosa-integration
andybak Jul 7, 2024
b8cdc01
Updated urls
andybak Jul 10, 2024
d530368
Fix assets api url. remove useless property
andybak Jul 10, 2024
d7112ac
Editor utility to ease testing of logged in actions
andybak Jul 11, 2024
14baac5
Unused method
andybak Jul 11, 2024
ba2d85d
Allow unauthenticated logins
andybak Jul 11, 2024
2f39e33
Use Icosa icon instead of Poly
andybak Jul 11, 2024
fe41fd4
Fixes and changes for Icosa API integration
andybak Jul 12, 2024
7c8911c
Handle weird situations where we init API too early.
andybak Jul 12, 2024
20a4952
Icosa model loading is working finally
andybak Jul 13, 2024
3bcfd28
Fix login base urls and make Icosa urls overrideable
andybak Jul 14, 2024
c7cbd64
Minor changes
andybak Jul 14, 2024
be018e2
Unbreak Google login
andybak Jul 14, 2024
292bce3
Redundant default param
andybak Jul 14, 2024
7cc4890
Google login enum. Remove redundant code
andybak Jul 14, 2024
bcd668e
Fix monoscopic reticle bounds
andybak Jul 14, 2024
45557e7
Remove formerly serialized attributes
andybak Jul 14, 2024
c26aeb3
Allow breaking apart on icosa models
andybak Jul 14, 2024
8f85801
Fix error when breaking up icosa models
andybak Jul 14, 2024
35df610
Use "blocks" pseudo-format
andybak Jul 15, 2024
88dc001
More room for title on sketchbook panel
andybak Jul 15, 2024
b4c6fc4
Use edit_url from upload response instead of job id
andybak Jul 16, 2024
7fab9b2
Remove out of date comment
andybak Aug 5, 2024
8228ffd
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Aug 15, 2024
4e3b80a
Merge branch 'main' into feature/icosa-integration
andybak Sep 11, 2024
a8eab36
Icosa panel shouldn't begin fixed
andybak Sep 12, 2024
68c819d
Renable poly button and rename to Icosa
andybak Sep 12, 2024
2e83abc
Disable m_UseLocalFeaturedSketches in the asset catalog
andybak Sep 12, 2024
e9c01c0
Curated also requiresIcosa now. Remove duplicate code.
andybak Sep 12, 2024
a862b99
Add a comment
andybak Sep 12, 2024
1032622
We now have assetId directly in the api results
andybak Sep 12, 2024
698ea97
Better logging
andybak Sep 12, 2024
be6f11e
Remove some logging noise
andybak Sep 12, 2024
426a05d
Update a comment
andybak Sep 12, 2024
33b5394
Some code prepping for dynamic switching between online/offline featu…
andybak Sep 12, 2024
67ff241
We now have assetid available
andybak Sep 12, 2024
ade568e
Handle missing thumbnails better
andybak Sep 12, 2024
ccfd9d3
No need to check GoogleIdentity here
andybak Sep 12, 2024
4ab872d
Make user models panel the default
andybak Sep 12, 2024
a7c7434
Disable m_InternetError as well before figuring out general panel vis…
andybak Sep 12, 2024
41a7ef4
Remove debug log
andybak Sep 12, 2024
653e3a6
Tweak default lister params
andybak Sep 14, 2024
97c5097
Limit the number of pages we retrieve
andybak Sep 14, 2024
ac0121e
Not sure what changed the main scene
andybak Sep 14, 2024
0f89153
Avoid errors when author is missing
andybak Sep 14, 2024
193bb31
Log a warning if we can't find a GLTF2
andybak Sep 15, 2024
60e864c
Sort featured sketches by "best"
andybak Sep 15, 2024
cb24340
Update packages-lock.json
andybak Sep 25, 2024
f0b4547
Comment
andybak Sep 25, 2024
08bb3d4
Comment
andybak Sep 25, 2024
a051f12
Fix: authorname not displayname
andybak Nov 13, 2024
430e328
Add some TODOs and commented-out wip code
andybak Nov 13, 2024
26da063
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Nov 13, 2024
e7d846b
Use correct API url
andybak Nov 13, 2024
fb66e70
More fixes for non-runtime gltf export
andybak Nov 19, 2024
7c3a217
Switch back to Openxr
andybak Nov 23, 2024
04c3ebf
Revert "Switch back to Openxr"
andybak Nov 23, 2024
e479c83
Switch back to Openxr
andybak Nov 23, 2024
547affb
initial fix: enable unpacking GLTF models multiple levels
eeropomell Nov 26, 2024
ef18b58
optimize a method in BreakModelApartCommand
eeropomell Dec 1, 2024
a02b0ba
We should include extras in all GLTF exports
andybak Dec 2, 2024
3c73383
Merge remote-tracking branch 'eeropomell/fix/gltf-import-unpack-objec…
andybak Dec 2, 2024
64ad82a
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Dec 5, 2024
fbe5aa8
Rider package update
andybak Dec 6, 2024
fb3ace5
License filter works now.
andybak Dec 6, 2024
3564933
Remove old comment
andybak Dec 6, 2024
5aa6a9f
Accept GLTF2
andybak Dec 6, 2024
6af1917
add clarifying comments to ModelWidget
eeropomell Dec 6, 2024
ad3fa0d
add initial version for a map from unique id to each node in a Model
eeropomell Dec 6, 2024
5de976f
switch from default string concat to StringBuilder as it's faster
eeropomell Dec 6, 2024
a14492b
remove unnecessary using directive
eeropomell Dec 6, 2024
219270c
[CI BUILD DEV] [CI BUILD]
eeropomell Dec 7, 2024
d8aa0c7
add profile markers for profiling Model.cs
eeropomell Dec 7, 2024
ea48923
Simplify unique node name generation logic
eeropomell Dec 8, 2024
0d2e987
apply code formatting
eeropomell Dec 8, 2024
274a6a3
Update UnityGLTF
andybak Dec 8, 2024
ae83bff
Very basic support for importing files with multiple resources via th…
andybak Dec 8, 2024
e344cce
[CI BUILD]
andybak Dec 9, 2024
76d9082
Log UnityGLTF exceptions when falling back to legacy
andybak Dec 9, 2024
b23622d
Quick test to see if hashes in the file path are the cause of the bug…
andybak Dec 9, 2024
8e73b80
Remove # from the productName, if set (affects save path)
mikeage Dec 10, 2024
226f3a5
Remove # from the 'description'
mikeage Dec 10, 2024
2c0e55f
Revert "Quick test to see if hashes in the file path are the cause of…
andybak Dec 10, 2024
f7c91b8
Merge remote-tracking branch 'mikeage/rename_pr_build' into feature/i…
andybak Dec 10, 2024
7ac28f7
Undo formatting changes
andybak Dec 10, 2024
c944cab
fix a mistaken formatting fix
andybak Dec 10, 2024
c228c1a
Merge branch 'fix/modelwidget-subtree-string-handling' into feature/i…
andybak Dec 13, 2024
4ab74a4
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Dec 22, 2024
10d1b64
Services enum for Icosa changed during merge :(
andybak Dec 22, 2024
4fdc145
Catch null (Icosa doesn't have or need secrets at the moment)
andybak Dec 22, 2024
502402c
Modified English text for View-only mode (other languages are still n…
andybak Dec 30, 2024
50f843e
Improved View-only UI
andybak Dec 30, 2024
9d67774
Add TODO
andybak Dec 31, 2024
608c5be
Filter on triangles when we make API requests
andybak Dec 31, 2024
c3744f6
Single source of truth for licence filter value
andybak Dec 31, 2024
0d6896a
Set max triangles for poly api lister
andybak Dec 31, 2024
bb41080
Fix typo
andybak Dec 31, 2024
76c6db1
Fix error when undo breaking apart a model
andybak Dec 31, 2024
8ccfa9b
Merge branch 'main' into feature/icosa-integration
andybak Jan 13, 2025
024108b
Poly > Icosa in localized strings
andybak Jan 19, 2025
e517097
Merge branch 'main' into feature/icosa-integration
andybak Jan 19, 2025
1af184f
Refactor Model constructor to so we don't need pass in a Location ins…
andybak Jan 22, 2025
8cdaf9a
Fix bug loading cached remote files with spaces in the name via Unity…
andybak Jan 23, 2025
b0905f2
Try IL2CPP on Windows
andybak Jan 23, 2025
acdf747
Fixes bug where sketchbook panel is opened if a sketch is loaded by a…
andybak Feb 1, 2025
61ae12e
Device login API endpoint
andybak Feb 1, 2025
4d86561
Fixes a bug where simply asking for the human name of a model would f…
andybak Feb 1, 2025
d7c015f
Experimental support for uploading newglb to Icosa
andybak Feb 1, 2025
aff4ed0
no need for FormerlySerializedAs
andybak Feb 1, 2025
f00fdb0
Stop logging controller glitches
andybak Feb 5, 2025
6258f66
Rename config item GenerateNewGlb to UseNewGlb
andybak Feb 5, 2025
783b0d6
Add some icons for icosa panel
andybak Feb 13, 2025
b655aaa
This fixes editor issues with localization
andybak Feb 13, 2025
fdaa6de
New Popups and buttons for Icosa Panel
andybak Feb 13, 2025
26cab43
Localization updates
andybak Feb 13, 2025
0f0e206
Update some non-localized strings
andybak Feb 13, 2025
40ef7dc
Initial UI work for search/filter UI
andybak Feb 13, 2025
340fba4
Strip trailing ampersands from all requests
andybak Feb 13, 2025
a613352
Remove artificial limit on number of paginated requests
andybak Feb 13, 2025
0594e9d
Fix double &
andybak Feb 13, 2025
a9754c2
New icons
andybak Feb 16, 2025
c6cce63
Filter/sort options mostly working
andybak Feb 16, 2025
1019047
Reuse details from lister API request instead of making separate requ…
andybak Feb 17, 2025
8457a66
Various fixes for icosa result filtering UI
andybak Feb 18, 2025
6272f05
Icosa UI updates - mainly text
andybak Feb 19, 2025
34bc69d
Reduce number of assets per page
andybak Feb 19, 2025
d55a9fc
More icosa ui tweaks
andybak Feb 19, 2025
c162692
Button hover value had accidentally been changed
andybak Feb 19, 2025
08233e8
dotnet format
andybak Feb 19, 2025
d4e576e
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Feb 19, 2025
94a2749
Missed dotnet format for these on previous run
andybak Feb 19, 2025
cf602cb
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Feb 19, 2025
30a7977
Don't import lights when using GLTFast
andybak Feb 19, 2025
c37c1cd
Don't import cameras when using UnityGLTF (already true for GLTFast)
andybak Feb 19, 2025
b52197a
Avoid creating lights for GOOGLE_lighting_rig extras
andybak Feb 20, 2025
32db826
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Feb 27, 2025
749f208
[CI BUILD]
andybak Mar 8, 2025
eaa0258
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Apr 15, 2025
4cb7581
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Apr 21, 2025
6697b3f
Post-merge changes to main scene
andybak Apr 21, 2025
300bad9
Some materials were mislabeled as audio reactive
andybak Apr 25, 2025
c13e247
Fix button texture
andybak May 1, 2025
c21a5e6
Downgrade asset errors to warnings
andybak May 1, 2025
18badde
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak May 1, 2025
d969cb2
Post-merge fixes
andybak May 1, 2025
077db2e
Update NoPeekingCamera.prefab
andybak May 1, 2025
2eab532
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak May 1, 2025
c6de0a3
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak May 20, 2025
05871d0
Fix case for display name
andybak May 20, 2025
b54273f
edit_url is now publishUrl. A few other minor related changes
andybak May 20, 2025
d0f2283
Tweak log output
andybak May 20, 2025
9479dc3
Merge branch 'main' into feature/icosa-integration
andybak May 21, 2025
e3835e6
WIP Implement search filter for sketchbook panel
andybak May 22, 2025
8aef9a0
Fix api command example
andybak May 22, 2025
4619ffa
Better forced refresh logic
andybak May 23, 2025
29cb405
Tweak license choices to match Blocks
andybak May 23, 2025
16bde50
Init curated button state
andybak May 23, 2025
a9857c3
Remove unused property
andybak May 23, 2025
b6492fb
Update filter popup prefabs to
andybak May 23, 2025
2ca7305
formatting
andybak May 23, 2025
f21bea5
UI updates
andybak May 23, 2025
02b58a3
Change items per page and page limit
andybak May 23, 2025
6a65c9d
Forced refresh overrides existing coroutines
andybak May 23, 2025
1ceaef3
Rename stuff so it's obvious when we're forcing a refresh
andybak May 23, 2025
7a4fb92
Filter button labels
andybak May 26, 2025
3147cf6
Update button wording
andybak May 26, 2025
70cb62a
Comment
andybak May 26, 2025
12852a2
Refactor duplicate code so we can all it on forced refresh
andybak May 26, 2025
79734cd
Cache sketch json when loading lister (same as for models)
andybak May 26, 2025
d338eaa
Now we also handle glbs we can't fail on missing .bin files
andybak May 26, 2025
5fb5561
Minor code cleanup
andybak May 26, 2025
180f81e
Don't delete old downloads (temp fix - needs more work)
andybak May 26, 2025
402aff2
Add as TODO
andybak May 27, 2025
7654aa7
Switch back to the official UnityGLTF repo
andybak May 29, 2025
09a5b26
Better handling of duplicate brush materials. Fix some current duplic…
andybak May 29, 2025
6327a7d
Changes caused by UnityGLTF package update
andybak May 29, 2025
6308762
Fix a potential null reference
andybak May 29, 2025
e43f493
Fix pragma definition for scripted shader animation
andybak May 30, 2025
917ca2e
Add ability to prune sketch cache down to configurable size
bnco-dev May 30, 2025
4de2440
Copy lifetime for dancefloor shader into uv1.x
andybak Jun 2, 2025
6075612
Apply pre-commit
bnco-dev Jun 3, 2025
3330e13
Download tilt files on-demand
bnco-dev Jun 4, 2025
c2cec37
Merge
bnco-dev Jun 4, 2025
a344314
Fix load not triggered on icon press
bnco-dev Jun 4, 2025
c2396ec
Merge remote-tracking branch 'origin/main' into feature/icosa-integra…
andybak Jun 5, 2025
b48ff32
Allow null subtrees
bnco-dev Jun 5, 2025
f3fad53
Fix cancel behaviour in on-demand tilt download
bnco-dev Jun 6, 2025
d14071a
Icosa panel should not begin fixed
andybak Jun 7, 2025
8dc7371
Catch a potential null error
andybak Jun 9, 2025
ece62d6
Remove GLTFast
andybak Jun 9, 2025
518cbe3
Non-critical package updates
andybak Jun 9, 2025
6e33f98
Update xr.openxr and xr.management packages
andybak Jun 9, 2025
2f40d9e
Settings updated mainly due to xr package updates
andybak Jun 9, 2025
1b89ed3
Update UnityGLTFSettings.asset
andybak Jun 9, 2025
a43f1d6
Remove separate mobile version of Icosa panel
andybak Jun 9, 2025
10132f5
Unity changed this, not me.
andybak Jun 9, 2025
13432cf
Another automated change
andybak Jun 9, 2025
b99afd7
Remove some logging
andybak Jun 9, 2025
32fd79b
Show error code when logging an asset service error
andybak Jun 9, 2025
7ace9b0
Typo
andybak Jun 9, 2025
0ee7f2d
Merge two logging statements into one
andybak Jun 9, 2025
b375467
Another automated change
andybak Jun 9, 2025
59fa3b8
Update SketchbookPanel_Mobile.prefab
andybak Jun 10, 2025
ca09e66
Increase mobile memory limits
andybak Jun 10, 2025
78c45d4
Update sketch search on keyboard submit
andybak Jun 10, 2025
3d2b9a3
Remove bundled sketches
andybak Jun 10, 2025
b099f50
Change the no sketches message
andybak Jun 10, 2025
d3af444
Localization entry for previous commit
andybak Jun 10, 2025
0132546
Deactivate lights on import until we have proper support
andybak Jun 10, 2025
cf7d9b4
Only show sketches in the drop down if they are downloaded and available
andybak Jun 10, 2025
cf1db51
Disable event system as it conflicts with the one on the NoPeekingCamera
andybak Jun 12, 2025
644e1b9
Change page limit and items per page for API requests
andybak Jun 12, 2025
e872cae
Remove unused serialized property
andybak Jun 12, 2025
756bf35
Add a comment
andybak Jun 12, 2025
95de582
Download some featured sketches on non-vr startup
andybak Jun 12, 2025
132b779
Change "Featured Sketches" to something more neutral
andybak Jun 13, 2025
a0210bb
dotnet format
andybak Jun 13, 2025
a8f33d8
Log network errors as warnings
andybak Jun 14, 2025
18c8ad2
Log warning if the lister didn't cache this item for some reason
andybak Jun 14, 2025
4ba8900
Update UnityGLTFSettings.asset
andybak Jun 14, 2025
cd15014
Revert "Increase mobile memory limits"
andybak Jun 14, 2025
84458ab
Update the upload url
andybak Jun 15, 2025
d378522
Use $ strings
andybak Jun 15, 2025
1a0a04b
Turn down excessive Photon voice logging
andybak Jun 15, 2025
53ec39a
Remove a debug log
andybak Jun 15, 2025
6788b90
Replace menu icon that came from Photon examples
andybak Jun 16, 2025
6f901e3
Update a comment
andybak Jun 16, 2025
047af91
Fix for Icosa imported model transforms
andybak Jun 17, 2025
8209219
Name overloads explicitly for clarity. Remove duplicate code
andybak Jun 17, 2025
f19b2fb
WIP fix
andybak Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ MonoBehaviour:
m_SerializedData: []
m_GUID: b22b61b24d64ca54da08ba1ca87b4b94
m_SerializeEntries:
- m_GUID: c84355079ab3f3e4f8f3812258805f86
m_Address: Assets/Settings/Locales/Strings/Strings Shared Data.asset
- m_GUID: 883bc2d92cda37c47bdfa332b2f1e17c
m_Address: Assets/Settings/Localization/Assets/Assets Shared Data.asset
m_ReadOnly: 1
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 883bc2d92cda37c47bdfa332b2f1e17c
m_Address: Assets/Settings/Localization/Assets/Assets Shared Data.asset
- m_GUID: c84355079ab3f3e4f8f3812258805f86
m_Address: Assets/Settings/Locales/Strings/Strings Shared Data.asset
m_ReadOnly: 1
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
Expand Down
28 changes: 14 additions & 14 deletions Assets/AddressableAssetsData/AssetGroups/Localization-Locales.asset
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,14 @@ MonoBehaviour:
m_SerializedData: []
m_GUID: ed8ca8eb09458634abe68aa77294b7c5
m_SerializeEntries:
- m_GUID: 887d91eb154761a4cb852d5288e9a633
m_Address: Japanese
m_ReadOnly: 1
m_SerializedLabels:
- Locale
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 24f69ae89af7fd24fb05a3798905dc72
m_Address: French
m_ReadOnly: 1
m_SerializedLabels:
- Locale
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: f449db273dfc44449aa79eaa7135399b
m_Address: German
- m_GUID: 35f3779472064f74bafddfc140d73eb6
m_Address: English
m_ReadOnly: 1
m_SerializedLabels:
- Locale
Expand All @@ -41,8 +35,8 @@ MonoBehaviour:
m_SerializedLabels:
- Locale
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 35f3779472064f74bafddfc140d73eb6
m_Address: English
- m_GUID: 887d91eb154761a4cb852d5288e9a633
m_Address: Japanese
m_ReadOnly: 1
m_SerializedLabels:
- Locale
Expand All @@ -53,14 +47,20 @@ MonoBehaviour:
m_SerializedLabels:
- Locale
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: f49fe9bebe68e674098c99a8c94562c4
m_Address: Chinese (Simplified)
- m_GUID: e2ba012692bce904dac44b1d2a724c20
m_Address: Debug
m_ReadOnly: 1
m_SerializedLabels:
- Locale
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: e2ba012692bce904dac44b1d2a724c20
m_Address: Debug
- m_GUID: f449db273dfc44449aa79eaa7135399b
m_Address: German
m_ReadOnly: 1
m_SerializedLabels:
- Locale
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: f49fe9bebe68e674098c99a8c94562c4
m_Address: Chinese (Simplified)
m_ReadOnly: 1
m_SerializedLabels:
- Locale
Expand Down
8 changes: 4 additions & 4 deletions Assets/Editor/DummyCommandRefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ public static void Prefabs_Panels_MemoryWarningPanel()
public static void Prefabs_Panels_PolyPanel()
{
Use(GlobalCommands.LoginToGenericCloud);
Use(GlobalCommands.ViewPolyGallery);
Use(GlobalCommands.ViewPolyPage);
Use(GlobalCommands.ViewBlocksGallery);
Use(GlobalCommands.ViewIcosaHomePage);
}

public static void Prefabs_Panels_PolyPanel_Mobile()
{
Use(GlobalCommands.LoginToGenericCloud);
Use(GlobalCommands.ViewPolyGallery);
Use(GlobalCommands.ViewPolyPage);
Use(GlobalCommands.ViewBlocksGallery);
Use(GlobalCommands.ViewIcosaHomePage);
}

public static void Prefabs_Panels_ReferencePanel_ReferencePanel_Mobile()
Expand Down
191 changes: 128 additions & 63 deletions Assets/Editor/GlTF_EditorExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
using System.Text;
using JetBrains.Annotations;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SimpleJSON;
using UnityEditor;
using UnityEditor.ShaderGraph.Serialization;
using UnityEngine;
using UnityGLTF;
using UnityGLTF.Extensions;
using UObject = UnityEngine.Object;

namespace TiltBrush
Expand Down Expand Up @@ -95,7 +100,7 @@ private static void ExportBrushStrokes_gltf1()
{
new ExportGlTF().ExportBrushStrokes(
GetExportBaseName() + ".gltf",
AxisConvention.kGltfAccordingToPoly,
AxisConvention.kGltfAccordingToIcosa,
binary: false,
doExtras: true,
gltfVersion: 1,
Expand Down Expand Up @@ -128,75 +133,135 @@ private static bool ExportBrushStrokes_Enabled()
[MenuItem("Open Brush/glTF/Export Environments to glTF", false, 4)]
private static void ExportEnvironments()
{
#if !GAMEOBJ_EXPORT_TO_GLTF
Debug.LogError("Enable the define and fix up the code");
#else
// Save the original RenderSettings
Environment.RenderSettingsLite originalRenderSettings = Environment.GetRenderSettings();

// Clear out the existing environments directory to do a clean export
string projectPath = Path.GetDirectoryName(Application.dataPath);
string environmentExportPath = Path.Combine(projectPath,
ExportUtils.kProjectRelativeEnvironmentExportRoot);
try {
Directory.Delete(environmentExportPath, recursive: true);
} catch (DirectoryNotFoundException) {
// It's okay if this directory doesn't exist yet as it will be created later.
}
// Save the original RenderSettings
Environment.RenderSettingsLite originalRenderSettings = Environment.GetRenderSettings();

// Clear out the existing textures directory to do a clean export
string textureExportPath = Path.Combine(projectPath,
ExportUtils.kProjectRelativeTextureExportRoot);
try {
Directory.Delete(textureExportPath, recursive: true);
} catch (DirectoryNotFoundException) {
// It's okay if this directory doesn't exist yet as it will be created later.
}
if (!FileUtils.InitializeDirectoryWithUserError(
textureExportPath, "Failed to export, can't create texture export directory")) {
return;
}
// Clear out the existing environments directory to do a clean export
string projectPath = Path.GetDirectoryName(Application.dataPath);
string environmentExportPath = Path.Combine(projectPath,
ExportUtils.kProjectRelativeEnvironmentExportRoot);
try
{
Directory.Delete(environmentExportPath, recursive: true);
}
catch (DirectoryNotFoundException)
{
// It's okay if this directory doesn't exist yet as it will be created later.
}

// Get the environment
TiltBrushManifest manifest = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest.asset");
foreach (Environment env in manifest.Environments) {
// Copy over the RenderSettings
Environment.SetRenderSettings(env.m_RenderSettings);

// Set up the environment
string envGuid = env.m_Guid.ToString("D");
Debug.LogFormat("Exporting environment: {0}", env.m_RenderSettings.m_EnvironmentPrefab);
GameObject envPrefab = Resources.Load<GameObject>(env.m_RenderSettings.m_EnvironmentPrefab);
GameObject envGameObject = UObject.Instantiate(envPrefab);
envGameObject.name = envGuid;

// Hide game objects that don't get exported to Poly.
foreach (Transform child in envGameObject.transform) {
if (SceneSettings.ExcludeFromPolyExport(child)) {
child.gameObject.SetActive(false);
}
}
// Clear out the existing textures directory to do a clean export
string textureExportPath = Path.Combine(projectPath,
ExportUtils.kProjectRelativeTextureExportRoot);
try
{
Directory.Delete(textureExportPath, recursive: true);
}
catch (DirectoryNotFoundException)
{
// It's okay if this directory doesn't exist yet as it will be created later.
}
if (!FileUtils.InitializeDirectoryWithUserError(
textureExportPath, "Failed to export, can't create texture export directory"))
{
return;
}

// Set up the environment export directory
string directoryName = Path.Combine(environmentExportPath, envGuid);
if (!FileUtils.InitializeDirectoryWithUserError(
directoryName, "Failed to export, can't create environment export directory")) {
return;
}
// Get the environment
TiltBrushManifest manifest = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest.asset");
JToken colorToJArray(Color c) => JToken.FromObject(new { c.r, c.g, c.b, c.a });
JToken vector3ToJArray(Vector3 c) => JToken.FromObject(new { c.x, c.y, c.z });
var envJson = new JObject();
foreach (Environment env in manifest.Environments)
{
// Copy over the RenderSettings
Environment.SetRenderSettings(env.m_RenderSettings);

// Set up the environment
string envGuid = env.m_Guid.ToString("D");
var envJsonItem = new JObject();
envJsonItem["name"] = env.name;
envJsonItem["guid"] = envGuid;
var envRenderSettingsJson = new JObject();
envRenderSettingsJson["fogEnabled"] = env.m_RenderSettings.m_FogEnabled;
envRenderSettingsJson["fogColor"] = colorToJArray(env.m_RenderSettings.m_FogColor);
envRenderSettingsJson["fogDensity"] = env.m_RenderSettings.m_FogDensity;
envRenderSettingsJson["fogStartDistance"] = env.m_RenderSettings.m_FogStartDistance;
envRenderSettingsJson["fogEndDistance"] = env.m_RenderSettings.m_FogEndDistance;
envRenderSettingsJson["clearColor"] = colorToJArray(env.m_RenderSettings.m_ClearColor);
envRenderSettingsJson["ambientColor"] = colorToJArray(env.m_RenderSettings.m_AmbientColor);
envRenderSettingsJson["skyboxExposure"] = env.m_RenderSettings.m_SkyboxExposure;
envRenderSettingsJson["skyboxTint"] = colorToJArray(env.m_RenderSettings.m_SkyboxTint);
envRenderSettingsJson["environmentPrefab"] = env.m_RenderSettings.m_EnvironmentPrefab;
envRenderSettingsJson["environmentReverbZone"] = env.m_RenderSettings.m_EnvironmentReverbZonePrefab;
envRenderSettingsJson["skyboxCubemap"] = env.m_RenderSettings.m_SkyboxCubemap != null ?
env.m_RenderSettings.m_SkyboxCubemap.name : "";
envRenderSettingsJson["reflectionCubemap"] = env.m_RenderSettings.m_ReflectionCubemap != null ?
env.m_RenderSettings.m_ReflectionCubemap.name : "";
envRenderSettingsJson["reflectionIntensity"] = env.m_RenderSettings.m_ReflectionIntensity;
envJsonItem["renderSettings"] = envRenderSettingsJson;
var envLights = new JArray();
foreach (var light in env.m_Lights)
{
var envLight = new JObject();
envLight["color"] = colorToJArray(light.Color);
envLight["position"] = vector3ToJArray(light.m_Position);
envLight["rotation"] = vector3ToJArray(light.m_Rotation.eulerAngles);
envLight["type"] = light.m_Type.ToString();
envLight["range"] = light.m_Range;
envLight["spotAngle"] = light.m_SpotAngle;
envLight["shadowsEnabled"] = light.m_ShadowsEnabled;
envLights.Add(envLight);

string basename = FileUtils.SanitizeFilename(envGameObject.name);
string gltfName = Path.Combine(directoryName, basename + ".gltf");
}
envJsonItem["lights"] = envLights;
envJsonItem["teleportBoundsHalfWidth"] = env.m_TeleportBoundsHalfWidth;
envJsonItem["controllerXRayHeight"] = env.m_ControllerXRayHeight;
envJsonItem["widgetHome"] = vector3ToJArray(env.m_WidgetHome);
envJsonItem["skyboxColorA"] = colorToJArray(env.m_SkyboxColorA);
envJsonItem["skyboxColorB"] = colorToJArray(env.m_SkyboxColorB);
envJson[envGuid] = envJsonItem;

Debug.LogFormat("Exporting environment: {0}", env.m_RenderSettings.m_EnvironmentPrefab);
GameObject envPrefab = Resources.Load<GameObject>(env.m_RenderSettings.m_EnvironmentPrefab);
GameObject envGameObject = UObject.Instantiate(envPrefab);
envGameObject.name = envGuid;

// Hide game objects that don't get exported to Poly.
foreach (Transform child in envGameObject.transform)
{
if (SceneSettings.ExcludeFromPolyExport(child))
{
child.gameObject.SetActive(false);
}
}

var exporter = new ExportGlTF();
exporter.ExportGameObject(envGameObject, gltfName, env);
// Set up the environment export directory
string directoryName = Path.Combine(environmentExportPath, envGuid);
if (!FileUtils.InitializeDirectoryWithUserError(
directoryName, "Failed to export, can't create environment export directory"))
{
return;
}

// DestroyImmediate is required because editor mode never runs object garbage collection.
UObject.DestroyImmediate(envGameObject);
}
string basename = FileUtils.SanitizeFilename(envGameObject.name);

var settings = GLTFSettings.GetOrCreateSettings();
settings.UseMainCameraVisibility = false;
var context = new ExportContext();
var unityGltfexporter = new GLTFSceneExporter(envGameObject.transform, context);
unityGltfexporter.SaveGLB(directoryName, basename + ".glb");

// DestroyImmediate is required because editor mode never runs object garbage collection.
UObject.DestroyImmediate(envGameObject);
}

string jsonString = envJson.ToString();
string path = Path.Combine(environmentExportPath, "environments.json");
File.WriteAllText(path, jsonString);

// Restore the original RenderSettings
Environment.SetRenderSettings(originalRenderSettings);

// Restore the original RenderSettings
Environment.SetRenderSettings(originalRenderSettings);
#endif
}

private static Dictionary<Guid, BrushDescriptor> GetBrushes()
Expand Down
69 changes: 69 additions & 0 deletions Assets/Editor/RenderCubeMap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using UnityEngine;
using UnityEditor;
using System.IO;

public class RenderCubeMap : EditorWindow
{
[SerializeField]
static int faceSize = 1024;

[MenuItem("Open Brush/RenderCubeMap", false, 11)]
static void Init()
{
var cam = Camera.main;
var camPos = cam.transform.position;
var camRot = cam.transform.rotation;

// cam.fieldOfView = 45;
// cam.farClipPlane = 4000;
// cam.allowMSAA = false;

cam.transform.position = new Vector3(0, 10, 0);
cam.transform.rotation = Quaternion.identity;

RenderToCubeMap(Camera.main);

cam.transform.position = camPos;
cam.transform.rotation = camRot;
}

static void RenderToCubeMap(Camera Cam)
{
Cubemap cubemap = new Cubemap(faceSize, TextureFormat.ARGB32, false);

var cubeSavePath = Application.dataPath + "/cube" + ".png";

Cam.RenderToCubemap(cubemap, 63);
Texture2D flattenedTexture = new Texture2D(faceSize * 4, faceSize * 3, TextureFormat.ARGB32, false);
for (int i = 0; i < 6; i++)
{
int x = 0, y = 0;
switch (i)
{
case 0: x = faceSize; y = faceSize * 2; break; // Top
case 1: x = faceSize; y = 0; break; // Bottom
case 2: x = faceSize * 3; y = faceSize; break; // Right
case 3: x = 0; y = faceSize; break; // Left
case 4: x = faceSize; y = faceSize; break; // Front
case 5: x = faceSize * 2; y = faceSize; break; // Back
}
Graphics.CopyTexture(cubemap, i, 0, 0, 0, faceSize, faceSize, flattenedTexture, 0, 0, x, y);
}

byte[] bytes = flattenedTexture.EncodeToPNG();
DestroyImmediate(flattenedTexture, true);
File.WriteAllBytes(cubeSavePath, bytes);

// var tex2DSavePath = Application.dataPath + "/360tex" + ".jpg";
// renderTexCube.ConvertToEquirect(renderTex2D);
DestroyImmediate(cubemap, true);
// Texture2D tex2d = new Texture2D(faceSize, 2048, TextureFormat.RGB24,false);
// RenderTexture.active = renderTex2D;
// tex2d.ReadPixels(new Rect(0,0,renderTex2D.width, renderTex2D.height),0,0);
// DestroyImmediate(renderTex2D, true);
// tex2d.Apply();
// bytes = tex2d.EncodeToJPG();
// DestroyImmediate(tex2d, true);
// File.WriteAllBytes(tex2DSavePath, bytes);
}
}
11 changes: 11 additions & 0 deletions Assets/Editor/RenderCubeMap.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading