forked from icosa-foundation/open-brush
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from omn0mn0m/main
Merging to catch up
- Loading branch information
Showing
562 changed files
with
57,398 additions
and
2,875 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Acquire activation file | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
activation: | ||
name: Request manual activation file 🔑 | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Request manual activation file | ||
- name: Request manual activation file | ||
id: getManualLicenseFile | ||
uses: game-ci/unity-request-activation-file@v2 | ||
with: | ||
unityVersion: 2019.4.25f1 | ||
# Upload artifact (Unity_v20XX.X.XXXX.alf) | ||
- name: Expose as artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ steps.getManualLicenseFile.outputs.filePath }} | ||
path: ${{ steps.getManualLicenseFile.outputs.filePath }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,5 @@ jobs: | |
- uses: actions/setup-python@v2 | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
dotnet-version: '6.0.100' | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,112 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Text; | ||
using TiltBrush; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using Valve.Newtonsoft.Json.Utilities; | ||
using Object = UnityEngine.Object; | ||
// Copyright 2021 The Tilt Brush Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
public class BrushLister : MonoBehaviour | ||
namespace TiltBrush | ||
{ | ||
private static StringBuilder brushList; | ||
private static List<Guid> deprecated; | ||
private static TiltBrushManifest brushManifest; | ||
private static TiltBrushManifest brushManifestX; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using UnityEditor; | ||
using UnityEngine; | ||
using Object = UnityEngine.Object; | ||
|
||
[MenuItem("Tilt/Info/Brush Lister")] | ||
static void ListBrushes() | ||
public class BrushLister : MonoBehaviour | ||
{ | ||
brushList = new StringBuilder(); | ||
private static StringBuilder brushList; | ||
private static List<Guid> deprecated; | ||
private static TiltBrushManifest brushManifest; | ||
private static TiltBrushManifest brushManifestX; | ||
|
||
Object[] defaultBrushes = Resources.LoadAll("Brushes", typeof(BrushDescriptor)).ToArray(); | ||
var experimentalBrushes = Resources.LoadAll("X/Brushes", typeof(BrushDescriptor)).ToArray(); | ||
[MenuItem("Tilt/Info/Brush Lister")] | ||
static void ListBrushes() | ||
{ | ||
brushList = new StringBuilder(); | ||
|
||
brushManifest = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest.asset"); | ||
brushManifestX = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest_Experimental.asset"); | ||
Object[] defaultBrushes = Resources.LoadAll("Brushes", typeof(BrushDescriptor)).ToArray(); | ||
var experimentalBrushes = Resources.LoadAll("X/Brushes", typeof(BrushDescriptor)).ToArray(); | ||
|
||
deprecated = new List<Guid>(); | ||
brushManifest = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest.asset"); | ||
brushManifestX = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest_Experimental.asset"); | ||
|
||
foreach (BrushDescriptor b in defaultBrushes) { if (b.m_Supersedes != null) deprecated.Add(b.m_Supersedes.m_Guid); } | ||
foreach (BrushDescriptor b in experimentalBrushes) { if (b.m_Supersedes != null) deprecated.Add(b.m_Supersedes.m_Guid); } | ||
deprecated = new List<Guid>(); | ||
|
||
foreach (BrushDescriptor brush in defaultBrushes) { AppendValidBrushString(brush, false); } | ||
foreach (BrushDescriptor brush in experimentalBrushes) | ||
{ | ||
try { AppendValidBrushString(brush, true); } | ||
catch (Exception UnassignedReferenceException) | ||
foreach (BrushDescriptor b in defaultBrushes) | ||
{ | ||
Debug.Log($"Experimental brush loading error: {UnassignedReferenceException}"); | ||
if (b.m_Supersedes != null) deprecated.Add(b.m_Supersedes.m_Guid); | ||
} | ||
foreach (BrushDescriptor b in experimentalBrushes) | ||
{ | ||
if (b.m_Supersedes != null) deprecated.Add(b.m_Supersedes.m_Guid); | ||
} | ||
} | ||
|
||
Debug.Log($"{brushList}"); | ||
} | ||
foreach (BrushDescriptor brush in defaultBrushes) { AppendValidBrushString(brush, false); } | ||
foreach (BrushDescriptor brush in experimentalBrushes) | ||
{ | ||
try { AppendValidBrushString(brush, true); } | ||
catch (Exception UnassignedReferenceException) | ||
{ | ||
Debug.Log($"Experimental brush loading error: {UnassignedReferenceException}"); | ||
} | ||
} | ||
|
||
public static string getBrushRowString(BrushDescriptor brush, bool experimental) | ||
{ | ||
// Exclude legacy brushes | ||
if (brush.m_SupersededBy != null) return ""; | ||
var brushScripts = sniffBrushScript(brush); | ||
string prefabName = brush.m_BrushPrefab != null ? brush.m_BrushPrefab.name : ""; | ||
string materialName = brush.Material != null ? brush.Material.name : ""; | ||
string shaderName = brush.Material != null ? brush.Material.shader.name : ""; | ||
string manifest = ""; | ||
if (brushManifest.Brushes.Contains(brush) && brushManifestX.Brushes.Contains(brush)) | ||
{ | ||
manifest = "both"; | ||
Debug.Log($"{brushList}"); | ||
} | ||
else if (brushManifest.Brushes.Contains(brush)) | ||
|
||
public static string getBrushRowString(BrushDescriptor brush, bool experimental) | ||
{ | ||
manifest = "Default"; | ||
// Exclude legacy brushes | ||
if (brush.m_SupersededBy != null) return ""; | ||
var brushScripts = sniffBrushScript(brush); | ||
string prefabName = brush.m_BrushPrefab != null ? brush.m_BrushPrefab.name : ""; | ||
string materialName = brush.Material != null ? brush.Material.name : ""; | ||
string shaderName = brush.Material != null ? brush.Material.shader.name : ""; | ||
string manifest = ""; | ||
if (brushManifest.Brushes.Contains(brush) && brushManifestX.Brushes.Contains(brush)) | ||
{ | ||
manifest = "both"; | ||
} | ||
else if (brushManifest.Brushes.Contains(brush)) | ||
{ | ||
manifest = "Default"; | ||
} | ||
else if (brushManifestX.Brushes.Contains(brush)) | ||
{ | ||
manifest = "Experimental"; | ||
} | ||
return $"{brush.m_Description}\t{brush.m_AudioReactive}\t{prefabName}\t{materialName}\t{shaderName}\t{brushScripts}\t{experimental}\t{brush.m_SupersededBy}\t{manifest}"; | ||
} | ||
else if (brushManifestX.Brushes.Contains(brush)) | ||
|
||
public static string sniffBrushScript(BrushDescriptor brush) | ||
{ | ||
manifest = "Experimental"; | ||
GameObject prefab = brush.m_BrushPrefab; | ||
if (prefab == null) return ""; | ||
var componentNames = new List<string>(); | ||
foreach (MonoBehaviour c in prefab.GetComponents<MonoBehaviour>()) | ||
{ | ||
if (c.GetType() == typeof(MeshFilter) || c.GetType() == typeof(Transform) || c.GetType() == typeof(MeshRenderer)) continue; | ||
componentNames.Add(c.GetType().ToString().Replace("TiltBrush.", "")); | ||
} | ||
return string.Join(",", componentNames); | ||
} | ||
return $"{brush.m_Description}\t{brush.m_AudioReactive}\t{prefabName}\t{materialName}\t{shaderName}\t{brushScripts}\t{experimental}\t{brush.m_SupersededBy}\t{manifest}"; | ||
} | ||
|
||
public static string sniffBrushScript(BrushDescriptor brush) | ||
{ | ||
GameObject prefab = brush.m_BrushPrefab; | ||
if (prefab == null) return ""; | ||
var componentNames = new List<string>(); | ||
foreach (MonoBehaviour c in prefab.GetComponents<MonoBehaviour>()) | ||
public static void AppendValidBrushString(BrushDescriptor brush, bool experimental) | ||
{ | ||
if (c.GetType() == typeof(MeshFilter) || c.GetType() == typeof(Transform) || c.GetType() == typeof(MeshRenderer)) continue; | ||
componentNames.Add(c.GetType().ToString().Replace("TiltBrush.", "")); | ||
if (deprecated.Contains(brush.m_Guid)) return; | ||
var rowString = getBrushRowString(brush, experimental); | ||
if (rowString != "") brushList.AppendLine($"{rowString}"); | ||
} | ||
return string.Join(",", componentNames); | ||
} | ||
|
||
public static void AppendValidBrushString(BrushDescriptor brush, bool experimental) | ||
{ | ||
if (deprecated.Contains(brush.m_Guid)) return; | ||
var rowString = getBrushRowString(brush, experimental); | ||
if (rowString != "") brushList.AppendLine($"{rowString}"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright 2021 The Tilt Brush Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEditor; | ||
|
||
|
||
namespace TiltBrush | ||
{ | ||
public class BrushTagger | ||
{ | ||
[MenuItem("Tilt/Rewrite Brush Tags")] | ||
private static void TagBrushes() | ||
{ | ||
var whiteboardBrushes = new List<string> | ||
{ | ||
"Marker", | ||
"TaperedMarker", | ||
"SoftHighlighter", | ||
"CelVinyl", | ||
"Dots", | ||
"Icing", | ||
"Toon", | ||
"Wire", | ||
"MatteHull", | ||
"ShinyHull", | ||
"UnlitHull", | ||
}; | ||
|
||
TiltBrushManifest brushManifest = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest.asset"); | ||
TiltBrushManifest brushManifestX = AssetDatabase.LoadAssetAtPath<TiltBrushManifest>("Assets/Manifest_Experimental.asset"); | ||
|
||
var guids = AssetDatabase.FindAssets("t:BrushDescriptor"); | ||
foreach (var guid in guids) | ||
{ | ||
string path = AssetDatabase.GUIDToAssetPath(guid); | ||
BrushDescriptor brush = AssetDatabase.LoadAssetAtPath<BrushDescriptor>(path); | ||
|
||
brush.m_Tags = new List<string>(); | ||
|
||
EditorUtility.SetDirty(brush); | ||
|
||
if (whiteboardBrushes.Contains(brush.DurableName)) brush.m_Tags.Add("whiteboard"); | ||
if (brushManifest.Brushes.Contains(brush)) brush.m_Tags.Add("default"); | ||
if (brushManifestX.Brushes.Contains(brush)) brush.m_Tags.Add("experimental"); | ||
if (brush.m_AudioReactive) brush.m_Tags.Add("audioreactive"); | ||
|
||
if (brush.m_BrushPrefab == null) continue; | ||
if (brush.m_BrushPrefab.GetComponent<HullBrush>() != null) brush.m_Tags.Add("hull"); | ||
if (brush.m_BrushPrefab.GetComponent<GeniusParticlesBrush>() != null) brush.m_Tags.Add("particle"); | ||
if (brush.m_BrushPrefab.GetComponent<ParentBrush>() != null) brush.m_Tags.Add("broken"); | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.