Skip to content

Commit 243020f

Browse files
committed
- Added a new plugin settings "Enable Editable Node Tools",
that can be used to change the default value used for its corresponding property when instantiating HDA.
1 parent 1a9e551 commit 243020f

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Plugins/HoudiniEngineUnity/Editor/UI/HEU_SettingsWindow.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,19 @@ private bool DrawDetailsCooking()
549549
}
550550
}
551551

552+
HEU_EditorUI.DrawSeparator();
553+
{
554+
bool oldValue = HEU_PluginSettings.EditableNodesToolsEnabled;
555+
bool newValue = HEU_EditorUI.DrawToggleLeft(oldValue,
556+
"Enable Editable Node Tools",
557+
"Displays Editable Node Tools and generates the node's geometry, if asset has editable nodes.");
558+
if (newValue != oldValue)
559+
{
560+
HEU_PluginSettings.EditableNodesToolsEnabled = newValue;
561+
bChanged = true;
562+
}
563+
}
564+
552565
// Setting for unit tests only
553566
//HEU_EditorUI.DrawSeparator();
554567
//{

Plugins/HoudiniEngineUnity/Scripts/Asset/HEU_HoudiniAsset.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ public bool EditableNodesToolsEnabled
279279
set { _editableNodesToolsEnabled = value; }
280280
}
281281

282-
283282
// Read only ====
284283

285284
/// <inheritdoc />
@@ -1928,6 +1927,8 @@ private void Awake()
19281927
RequestReload(false);
19291928
}
19301929

1930+
_editableNodesToolsEnabled = HEU_PluginSettings.EditableNodesToolsEnabled;
1931+
19311932
// If there are curves they need to be cooked.
19321933
if (Curves != null)
19331934
{

Plugins/HoudiniEngineUnity/Scripts/Core/HEU_PluginSettings.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,5 +944,16 @@ public static bool CookOnMouseUp
944944
}
945945
set => HEU_PluginStorage.Instance.Set("HAPI_CookOnMouseUp", value);
946946
}
947+
948+
public static bool EditableNodesToolsEnabled
949+
{
950+
get
951+
{
952+
bool enabled = false;
953+
HEU_PluginStorage.Instance.Get("HAPI_EditableNodesToolsEnabled", out enabled, enabled);
954+
return enabled;
955+
}
956+
set => HEU_PluginStorage.Instance.Set("HAPI_EditableNodesToolsEnabled", value);
957+
}
947958
}
948959
} // HoudiniEngineUnity

0 commit comments

Comments
 (0)