Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing images bug #84

Merged
merged 32 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9d3578e
Refactor
mrbusysky Sep 1, 2023
cd22184
Updated to add lights when adding objects
mrbusysky Sep 2, 2023
1e08087
Fixing positions of the lights
mrbusysky Sep 2, 2023
7011a6e
Updating the algo and position
mrbusysky Sep 2, 2023
97b744d
Separated placing objects and cameras
mrbusysky Sep 2, 2023
3413edd
Updated remove
mrbusysky Sep 2, 2023
416fd68
testing
mrbusysky Sep 7, 2023
8be0588
Updating colors of buttons and background
mrbusysky Sep 7, 2023
b82bc48
Set min and color
mrbusysky Sep 7, 2023
db3a1be
Delete Scenario 3D Package Installer.cs
mrbusysky Sep 7, 2023
6130f8b
Revert "Delete Scenario 3D Package Installer.cs"
mrbusysky Sep 7, 2023
8d6fba7
Delete Scenario Package Installer 2.cs
mrbusysky Sep 7, 2023
a944c22
Pre Package
mrbusysky Sep 10, 2023
d6193d9
Merge branch 'develop' into Code_Refactor
mrbusysky Sep 10, 2023
a1febbd
file naming issue
mrbusysky Sep 11, 2023
3177fb8
Ui fixes
mrbusysky Sep 12, 2023
1fcccca
Packaging method
mrbusysky Sep 13, 2023
a3766b7
Update release.yml
mrbusysky Sep 13, 2023
119db3b
Update release.yml
mrbusysky Sep 13, 2023
6ef3a73
Merge branch 'develop' into Code_Refactor
mrbusysky Sep 13, 2023
8cb5833
Merge pull request #1 from mrbusysky/Code_Refactor
mrbusysky Sep 13, 2023
65d8a51
Update release.yml
mrbusysky Sep 13, 2023
f0ec317
namespace
mrbusysky Oct 9, 2023
d8574c3
Update package.json
mrbusysky Oct 9, 2023
450092d
Update PluginSettings.cs
mrbusysky Oct 9, 2023
270952c
Update package.json
mrbusysky Oct 9, 2023
b84004d
Update missing images
mrbusysky Oct 27, 2023
133604e
Merge branch 'develop' into missing-images-bug
mrbusysky Oct 27, 2023
6c2ab31
removed file as requested
mrbusysky Oct 27, 2023
6ac775a
Merge branch 'missing-images-bug' of https://github.com/mrbusysky/Sce…
mrbusysky Oct 27, 2023
530f0c6
update version checking
mrbusysky Oct 27, 2023
800beb6
don't belong
mrbusysky Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Scenario/Editor/Images/Images.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using Unity.Plastic.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using Newtonsoft.Json;

namespace Scenario
{
Expand Down
2 changes: 1 addition & 1 deletion Scenario/Editor/LayerEditor/ContextMenuActions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Unity.Plastic.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using Newtonsoft.Json;

namespace Scenario
{
Expand Down
2 changes: 1 addition & 1 deletion Scenario/Editor/Models/Models.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Unity.Plastic.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using Newtonsoft.Json;

namespace Scenario
{
Expand Down
2 changes: 1 addition & 1 deletion Scenario/Editor/PixelEditor/PixelEditorUI.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using Unity.Plastic.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using Newtonsoft.Json;

namespace Scenario
{
Expand Down
2 changes: 1 addition & 1 deletion Scenario/Editor/PromptImages/PromptImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
using System.Threading.Tasks;
using RestSharp;
using Unity.EditorCoroutines.Editor;
using Unity.Plastic.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using UnityEngine.Networking;
using Newtonsoft.Json;

namespace Scenario
{
Expand Down
4 changes: 2 additions & 2 deletions Scenario/Editor/PromptWindow/PromptWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Globalization;
using System.Linq;
using Unity.EditorCoroutines.Editor;
using Unity.Plastic.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using Newtonsoft.Json;

namespace Scenario
{
Expand Down Expand Up @@ -226,7 +226,7 @@ private string PrepareInputData(string modality, string operationType, string da
int width = (int)promptWindowUI.widthSliderValue;
int height = (int)promptWindowUI.heightSliderValue;
int numInferenceSteps = (int)promptWindowUI.samplesliderValue;
int numSamples = (int)promptWindowUI.imagesliderValue;
int numSamples = (int)promptWindowUI.imagesliderIntValue;

string inputData = $@"{{
""parameters"": {{
Expand Down
1 change: 1 addition & 0 deletions Scenario/Editor/PromptWindow/PromptWindowUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public partial class PromptWindowUI
internal int widthSliderValue = 512;
internal int heightSliderValue = 512;
internal float imagesliderValue = 4;
internal int imagesliderIntValue = 4;
internal float samplesliderValue = 30;
internal float influncesliderValue = 0.25f;
internal float guidancesliderValue = 7;
Expand Down
3 changes: 2 additions & 1 deletion Scenario/Editor/PromptWindow/Views/ImageSettingsView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ private void RenderImageSettingsSection(bool shouldAutoGenerateSeed)
int labelWidth = Mathf.RoundToInt(EditorGUIUtility.currentViewWidth * labelWidthPercentage);
int sliderWidth = Mathf.RoundToInt(EditorGUIUtility.currentViewWidth * sliderWidthPercentage);

int imagesliderIntValue = Mathf.RoundToInt(imagesliderValue);
imagesliderIntValue = Mathf.RoundToInt(imagesliderValue);

EditorGUILayout.BeginHorizontal();
{
GUILayout.Label("Images: " + imagesliderIntValue, GUILayout.Width(labelWidth));
Expand Down
2 changes: 1 addition & 1 deletion Scenario/Editor/UpscaleEditor/UpscaleEditorUI.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using Unity.Plastic.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using Newtonsoft.Json;

namespace Scenario
{
Expand Down
37 changes: 28 additions & 9 deletions Scenario/Plugins/PluginSettings.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using UnityEditor;
using UnityEngine;
using System.IO;

namespace Scenario
{
Expand All @@ -17,7 +18,24 @@ public class PluginSettings : EditorWindow
private readonly string[] imageFormats = { "JPEG", "PNG" };
private readonly string[] imageFormatExtensions = { "jpeg", "png" };

private static string version = "Scenario Beta Version 0.2.0";
private static string vnumber = "";
private static string version => $"Scenario Beta Version {vnumber}";

[System.Serializable]
private class PackageInfo
{
public string version;
}

[MenuItem("Scenario/Update Version")]
public static void UpdateVersionFromPackageJson()
{
string packageJsonPath = "Assets/Scenario/package.json";
string packageJsonContent = File.ReadAllText(packageJsonPath);
vnumber = JsonUtility.FromJson<PackageInfo>(packageJsonContent).version;

EditorWindow.GetWindow<PluginSettings>().Repaint();
}

public static string EncodedAuth
{
Expand All @@ -42,6 +60,12 @@ public static void ShowWindow()
window.minSize = new Vector2(minimumWidth, window.minSize.y);
}

private void OnEnable()
{
UpdateVersionFromPackageJson();
LoadSettings();
}

private void OnGUI()
{
Color backgroundColor = new Color32(18, 18, 18, 255);
Expand Down Expand Up @@ -84,13 +108,8 @@ private void OnGUI()
SaveSettings();
}

GUILayout.FlexibleSpace(); // This will push the version text to the bottom
GUILayout.Label(version, EditorStyles.boldLabel); // Add this line to display the version at the bottom
}

private void OnEnable()
{
LoadSettings();
GUILayout.FlexibleSpace();
GUILayout.Label(version, EditorStyles.boldLabel);
}

private void SaveSettings()
Expand All @@ -117,4 +136,4 @@ private void LoadSettings()
}
}
}
}
}
3 changes: 2 additions & 1 deletion Scenario/com.scenario.editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "com.scenario.editor",
"rootNamespace": "Scenario",
"references": [
"Unity.EditorCoroutines.Editor"
"Unity.EditorCoroutines.Editor",
"RestSharp.Unity"
],
"includePlatforms": [
"Editor"
Expand Down
4 changes: 2 additions & 2 deletions Scenario/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "com.scenario.editor",
"displayName": "Scenario Unity Plugin",
"version": "0.2.0",
"version": "0.2.3",
mrbusysky marked this conversation as resolved.
Show resolved Hide resolved
"unity": "2022.3",
"dependencies": {
"com.unity.editorcoroutines": "1.0.0",
"com.unity.nuget.newtonsoft-json": "2.0.0"
}
}
}