Skip to content

Commit

Permalink
Add new 2.7.0 Files
Browse files Browse the repository at this point in the history
  • Loading branch information
acchosen2 committed Jun 19, 2024
1 parent b65478a commit f521779
Show file tree
Hide file tree
Showing 52 changed files with 5,926 additions and 0 deletions.
1 change: 1 addition & 0 deletions Packages/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/*/
!com.vrchat.core.*/
!com.acchosen.vr-stage-lighting
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5234e5a618f589b49aa604ad3e28f500, type: 3}
m_Name: VRSL DMX Default Fixture Definitions
m_EditorClassIdentifier:
definitions:
- name: SpotLight 13CH
channelNames:
- Pan
- Fine Pan
- Tilt
- Fine Tilt
- Zoom
- Dimmer
- Strobe
- Red
- Green
- Blue
- GOBO Spin
- GOBO Select
- Movement Speed
foldOut: 0
- name: WashLight 13CH
channelNames:
- Pan
- Fine Pan
- Tilt
- Fine Tilt
- Zoom
- Dimmer
- Red
- Green
- Blue
- None
- None
- None
- Movement Speed
foldOut: 0
- name: ParLight 13CH
channelNames:
- None
- None
- None
- None
- None
- Dimmer
- Strobe
- Red
- Green
- Blue
- None
- None
- None
foldOut: 0
- name: Blinder 13CH
channelNames:
- None
- None
- None
- None
- None
- Dimmer
- Strobe
- Red
- Green
- Blue
- None
- None
- None
foldOut: 0
- name: LightBar 13CH
channelNames:
- None
- None
- None
- None
- None
- Dimmer
- Strobe
- Red
- Green
- Blue
- None
- None
- None
foldOut: 0
- name: ParLight 5CH
channelNames:
- Dimmer
- Red
- Green
- Blue
- Strobe
foldOut: 0
- name: Blinder 5CH
channelNames:
- Dimmer
- Red
- Green
- Blue
- Strobe
foldOut: 0
- name: LightBar 5CH
channelNames:
- Dimmer
- Red
- Green
- Blue
- Strobe
foldOut: 0
- name: Flasher 1CH
channelNames:
- Dimmer
foldOut: 0
- name: DiscoBall 1CH
channelNames:
- Dimmer
foldOut: 0
- name: Laser 13CH
channelNames:
- Pan
- Tilt
- Length
- Width
- Flatness
- Beam Count
- Spin Speed
- Red
- Green
- Blue
- Dimmer
- Beam Thickness
- Movement Speed
foldOut: 0
- name: Generic 5CH
channelNames:
- Dimmer
- Red
- Green
- Blue
- Strobe
foldOut: 0
- name: Other
channelNames:
- Unknown
foldOut: 1

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
#if !COMPILER_UDONSHARP && UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UdonSharpEditor;
using UnityEngine.SceneManagement;
using System.IO;
using System;

namespace VRSL.EditorScripts
{
public class VRSL_DMXPatchExporter : Editor
{
private static VRSL_LocalUIControlPanel panel;
private static List<GameObject> sceneObjects = new List<GameObject>();
public static bool hasLocalPanel;
static List<GameObject> GetAllObjectsOnlyInScene()
{
List<GameObject> objectsInScene = new List<GameObject>();

foreach (GameObject go in Resources.FindObjectsOfTypeAll(typeof(GameObject)) as GameObject[])
{
if (!EditorUtility.IsPersistent(go.transform.root.gameObject) && !(go.hideFlags == HideFlags.NotEditable || go.hideFlags == HideFlags.HideAndDontSave))
objectsInScene.Add(go);
}

return objectsInScene;
}
private static void CheckForLocalPanel()
{
sceneObjects = GetAllObjectsOnlyInScene();
hasLocalPanel = false;
panel = null;
// colorLabel = new GUIContent();
// colorLabel.text = "Emission Color";
foreach (GameObject go in sceneObjects)
{
#pragma warning disable 0618 //suppressing obsoletion warnings
panel = go.GetUdonSharpComponent<VRSL_LocalUIControlPanel>();
#pragma warning restore 0618
if(panel != null)
{
hasLocalPanel = true;
break;
}
}
return;
}


[MenuItem("VRSL/Save Patch Data", priority = 500)]
public static void SavePatchData()
{
CheckForLocalPanel();
if(!hasLocalPanel){Debug.LogWarning("VRSL Patch Exporter: Please make sure there is a VRSL-LocalUIControlPanel in your scene before attempting to save."); return;}
if(panel.fixtureSaveFile == "NONE")
{
try
{
VRSL_DMXPatchSettings asset = ScriptableObject.CreateInstance<VRSL_DMXPatchSettings>();
asset.SetDMXFixtureData();
string name = "VRSL DMX Patch Data_" + SceneManager.GetActiveScene().name + ".asset";
string parentDirectory = "VRSL DMX Patch Folder";
if(AssetDatabase.IsValidFolder("Assets/" + parentDirectory) == false)
{
AssetDatabase.CreateFolder("Assets", parentDirectory);
}
string path = "Assets/" + parentDirectory + "/" + name;
AssetDatabase.CreateAsset(asset, path);
// AssetDatabase.SaveAssets();

// EditorUtility.FocusProjectWindow();

// Selection.activeObject = asset;


SerializedObject so = new SerializedObject(panel);
so.FindProperty("fixtureSaveFile").stringValue = AssetDatabase.GUIDFromAssetPath(path).ToString();
so.ApplyModifiedProperties();
#pragma warning disable 0618 //suppressing obsoletion warnings
panel.UpdateProxy();
#pragma warning restore 0618 //suppressing obsoletion warnings
panel.fixtureSaveFile = so.FindProperty("fixtureSaveFile").stringValue;
#pragma warning disable 0618 //suppressing obsoletion warnings
panel.ApplyProxyModifications();
#pragma warning restore 0618 //suppressing obsoletion warnings

/// asset = (VRSL_DMXPatchSettings) AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(panel.fixtureSaveFile), typeof(VRSL_DMXPatchSettings));
// asset.SetScene();
// asset.SetDMXFixtureData();
asset.ForceSave();
}
catch
{
Debug.LogError("VRSL Patch Exporter: Failed to create patch data.");
}
}
else
{
try
{
VRSL_DMXPatchSettings asset = (VRSL_DMXPatchSettings) AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(panel.fixtureSaveFile), typeof(VRSL_DMXPatchSettings));
asset.SetScene();
asset.SetDMXFixtureData();
asset.ForceSave();
}
catch (NullReferenceException e)
{
// Debug.LogError("VRSL Patch Exporter: Could not find patch data file. Removing Link patch data link.");
e.GetType();
SerializedObject so = new SerializedObject(panel);
so.FindProperty("fixtureSaveFile").stringValue = "NONE";
so.ApplyModifiedProperties();
#pragma warning disable 0618 //suppressing obsoletion warnings
panel.UpdateProxy();
#pragma warning restore 0618 //suppressing obsoletion warnings
panel.fixtureSaveFile = so.FindProperty("fixtureSaveFile").stringValue;
#pragma warning disable 0618 //suppressing obsoletion warnings
panel.ApplyProxyModifications();
#pragma warning restore 0618 //suppressing obsoletion warnings
SavePatchData();
}
catch(Exception e)
{
Debug.LogError("VRSL Patch Exporter: Failed to save patch data.");
e.GetType();
}
}


}
[MenuItem("VRSL/Load Patch Data", priority = 501)]
public static void LoadPatchData()
{
CheckForLocalPanel();
if(!hasLocalPanel){Debug.LogWarning("VRSL Patch Exporter: Please make sure there is a VRSL-LocalUIControlPanel in your scene before attempting to Load."); return;}
if(panel.fixtureSaveFile != "NONE")
{
try
{
VRSL_DMXPatchSettings asset = (VRSL_DMXPatchSettings) AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(panel.fixtureSaveFile), typeof(VRSL_DMXPatchSettings));
asset.LoadDMXFixtureData();
}
catch
{
Debug.LogError("VRSL Patch Exporter: Failed to load patch data.");
}
}
else
{
Debug.LogError("VRSL Patch Exporter: Fixture Save File Not Found. The file may have been lost or has not been created yet.");
}
}
[MenuItem("VRSL/Export/To JSON", priority = 502)]
public static void ExportToJSON()
{
CheckForLocalPanel();
if(!hasLocalPanel){Debug.LogWarning("VRSL Patch Exporter: Please make sure there is a VRSL-LocalUIControlPanel in your scene before attempting to export."); return;}
if(panel.fixtureSaveFile != "NONE")
{
try
{
VRSL_DMXPatchSettings asset = (VRSL_DMXPatchSettings) AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(panel.fixtureSaveFile), typeof(VRSL_DMXPatchSettings));
asset.ToJsonFile(true);
}
catch
{
Debug.LogError("VRSL Patch Exporter: Failed to export patch data.");
}
}
else
{
Debug.LogError("VRSL Patch Exporter: Fixture Save File Not Found. The file may have been lost or has not been created yet.");
}
}

[MenuItem("VRSL/Export/To MVR", priority = 503)]
public static void ExportToMVR()
{
CheckForLocalPanel();
if(!hasLocalPanel){Debug.LogWarning("VRSL Patch Exporter: Please make sure there is a VRSL-LocalUIControlPanel in your scene before attempting to export."); return;}
if(panel.fixtureSaveFile != "NONE")
{
try
{
VRSL_DMXPatchSettings asset = (VRSL_DMXPatchSettings) AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(panel.fixtureSaveFile), typeof(VRSL_DMXPatchSettings));
asset.ToMVRFile();
}
catch
{
Debug.LogError("VRSL Patch Exporter: Failed to export patch data.");
throw;
}
}
else
{
Debug.LogError("VRSL Patch Exporter: Fixture Save File Not Found. The file may have been lost or has not been created yet.");
}
}

[MenuItem("VRSL/Export/To PDF", priority = 504)]
public static void ExportToPDF()
{
CheckForLocalPanel();
if(!hasLocalPanel){Debug.LogWarning("VRSL Patch Exporter: Please make sure there is a VRSL-LocalUIControlPanel in your scene before attempting to export."); return;}
if(panel.fixtureSaveFile != "NONE")
{
try
{
VRSL_DMXPatchSettings asset = (VRSL_DMXPatchSettings) AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(panel.fixtureSaveFile), typeof(VRSL_DMXPatchSettings));
asset.ToPDF();
}
catch
{
Debug.LogError("VRSL Patch Exporter: Failed to export patch data.");
throw;
}
}
else
{
Debug.LogError("VRSL Patch Exporter: Fixture Save File Not Found. The file may have been lost or has not been created yet.");
}
}
}
}
#endif
Loading

0 comments on commit f521779

Please sign in to comment.