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

DYN-6626: Add paneling nodes as an experimental feature #14920

Merged
merged 10 commits into from
Feb 15, 2024
8 changes: 5 additions & 3 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,9 +1145,11 @@ internal void InitializeNamespacesToExcludeFromLibrary()
{
if (!NamespacesToExcludeFromLibrarySpecified)
{
NamespacesToExcludeFromLibrary.Add(
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.TSpline"
);
NamespacesToExcludeFromLibrary = new List<string>()
{
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.TSpline",
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.Panel"
};
NamespacesToExcludeFromLibrarySpecified = true;
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

6 changes: 5 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3915,4 +3915,8 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="PublishPackageRetainFolderStructureToggleButtonText" xml:space="preserve">
<value>Retain folder structure</value>
</data>
</root>
<data name="PreferencesViewEnablePanelNodes" xml:space="preserve">
Copy link
Contributor

@aparajit-pratap aparajit-pratap Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not happy with the protogeometry class name - Panel as it actually represents a panel-mesh instead of a single panel. I'll probably change it after I get some initial feedback. On a similar note, I think Enable Paneling nodes would be more appropriate here.

<value>Enable Panel nodes</value>
<comment>Preferences | Features | Experimental | Enable Panel nodes</comment>
</data>
</root>
5 changes: 4 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3902,4 +3902,7 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="PublishPackageRetainFolderStructureToggleButtonText" xml:space="preserve">
<value>Retain folder structure</value>
</data>
</root>
<data name="PreferencesViewEnablePanelNodes" xml:space="preserve">
<value>Enable Panel nodes</value><comment>Preferences | Features | Experimental | Enable Panel nodes</comment>
</data>
</root>
20 changes: 20 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,23 @@ public bool EnableTSplineIsChecked
}
}

/// <summary>
/// Controls the IsChecked property in the "Enable Panel nodes" toogle button
/// </summary>
public bool EnablePanelIsChecked
{
get
{
return !preferenceSettings.NamespacesToExcludeFromLibrary.Contains(
"ProtoGeometry.dll:Autodesk.DesignScript.Geometry.Panel");
aparajit-pratap marked this conversation as resolved.
Show resolved Hide resolved
}
set
{
HideUnhideNamespace(!value, "ProtoGeometry.dll", "Autodesk.DesignScript.Geometry.Panel");
RaisePropertyChanged(nameof(EnablePanelIsChecked));
}
}

/// <summary>
/// This method updates the node search library to either hide or unhide nodes that belong
/// to a specified assembly name and namespace. These nodes will be hidden from the node
Expand Down Expand Up @@ -1759,6 +1776,9 @@ private void Model_PropertyChanged(object sender, PropertyChangedEventArgs e)
case nameof(EnableTSplineIsChecked):
description = Res.ResourceManager.GetString(nameof(Res.PreferencesViewEnableTSplineNodes), System.Globalization.CultureInfo.InvariantCulture);
goto default;
case nameof(EnablePanelIsChecked):
description = Res.ResourceManager.GetString(nameof(Res.PreferencesViewEnablePanelNodes), System.Globalization.CultureInfo.InvariantCulture);
goto default;
case nameof(ShowPreviewBubbles):
description = Res.ResourceManager.GetString(nameof(Res.PreferencesViewShowPreviewBubbles), System.Globalization.CultureInfo.InvariantCulture);
goto default;
Expand Down
20 changes: 20 additions & 0 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<StackPanel Orientation="Horizontal" Margin="0,12,0,0" Grid.Row="0">
Expand All @@ -1042,6 +1043,25 @@
Foreground="{StaticResource PreferencesWindowFontColor}"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,12,0,0" Grid.Row="1">
<ToggleButton Name="EnablePanelToggle"
Width="{StaticResource ToggleButtonWidth}"
Height="{StaticResource ToggleButtonHeight}"
VerticalAlignment="Center"
IsChecked="{Binding Path=EnablePanelIsChecked}"
Style="{StaticResource EllipseToggleButton1}"/>
<StackPanel VerticalAlignment="Center">
<Label Content="{x:Static p:Resources.PreferencesViewEnablePanelNodes}"
Padding="5,5,5,0"
Margin="10,0,0,0"
Foreground="{StaticResource PreferencesWindowFontColor}"/>
<Label Content="{x:Static p:Resources.PreferencesViewRequiresRelaunchOfDynamo}"
FontSize="10"
Margin="10,0,0,0"
Padding="5,0,5,5"
Foreground="{StaticResource PreferencesWindowFontColor}"/>
</StackPanel>
</StackPanel>
</Grid>
</Expander>

Expand Down
Loading