Skip to content

Commit

Permalink
fix: correspondence sizing image between capture and render
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLLspectre committed Jun 27, 2024
1 parent 045302e commit 8d45ad8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
10 changes: 5 additions & 5 deletions package/Editor/PlanarProjection/PlanarProjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public void OpenPromptWindow()
SetControlNetOptions();
InferenceManager.SilenceMode = true;
promptWindow.SetImageSettingWidth(1824);
promptWindow.SetImageSettingHeight(1024);
//promptWindow.SetImageSettingHeight(1024);
}
}

Expand Down Expand Up @@ -513,9 +513,9 @@ private void GetAllScenarioTagObject()
break;
}

if (tagged[i].transform.childCount > 0)
{

if (tagged[i].transform.childCount > 0 && referenceObject == null)
{
referenceObject = tagged[i];
}
}
}
Expand Down Expand Up @@ -1206,7 +1206,7 @@ IEnumerator CloseRecorder()
recorderWindow.Close();
recorderWindow = null;

yield return new EditorWaitForSeconds(2f);
yield return new EditorWaitForSeconds(1f);

directoryInfo = new DirectoryInfo($"{Application.dataPath}/Recordings");
LoadLastCapture();
Expand Down
6 changes: 5 additions & 1 deletion package/Editor/PlanarProjection/PlanarProjectionView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ private void BasicPrepareView()
}

planarProjection.ReferenceObject = (GameObject)EditorGUILayout.ObjectField(planarProjection.ReferenceObject, typeof(GameObject), true);

if (planarProjection.ReferenceObject != null)
{
if(!planarProjection.ReferenceObject.tag.Equals("Scenario Object Projection"))
planarProjection.ReferenceObject.tag = "Scenario Object Projection";
}


if (GUILayout.Button("Auto configure scene", button))
Expand Down
21 changes: 21 additions & 0 deletions package/Editor/PromptWindow/PromptWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ public void SetAdvancedModalityValue(int _value)
public void SetImageSettingWidth(int _indexValue)
{
promptWindowUI.WidthSliderValue = _indexValue;

if (_indexValue >= 1024)
{
for (int i = 0; i < promptWindowUI.allowedSDXLDimensionValues.Length; i++)
{
if (_indexValue == promptWindowUI.allowedSDXLDimensionValues[i])
{
promptWindowUI.sizeSliderValue = 7 - i;
}
}
}
else if(_indexValue <= 912)
{
for (int i = 0; i < promptWindowUI.allowed1_5DimensionValues.Length; i++)
{
if (_indexValue == promptWindowUI.allowed1_5DimensionValues[i])
{
promptWindowUI.sizeSliderValue = 7 - i;
}
}
}
}

/// <summary>
Expand Down

0 comments on commit 8d45ad8

Please sign in to comment.