Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into pm-p…
Browse files Browse the repository at this point in the history
…ublish-wizard
  • Loading branch information
zeusongit committed Mar 7, 2025
2 parents 2140360 + 124720c commit 22887ee
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!--- Autodesk.DesignScript.Geometry.TSpline.TSplineSurface.BySphereBestFit --->
<!--- RUAGD4YGKJ6XHPIKDL7GZX63CDAFMI6KUSR6XMXEBGJJOATEI5IA --->
## BySphereBestFit - Documentation
This documentation file is auto generated by NodeDocumentationMarkdownGenerator, Version=2.14.0.3986, Culture=neutral, PublicKeyToken=null.
## In-Depth
In the example below, a T-Spline sphere primitive surface is created using the `TSplineSurface.BySphereBestFit` node from a provided list of random points. `radiusSpans` and `heightSpans` inputs control the number of faces along the height and radial spans (or meridians). The `symmetry` input controls if the shape has initial symmetry and, finally, `inSmoothMode` defines if the preview is in smooth or box mode.

For more information about adding documentation to nodes see https://github.com/DynamoDS/Dynamo/wiki/Create-and-Add-Custom-Documentation-to-Nodes
## Example File

![Example](./Autodesk.DesignScript.Geometry.TSpline.TSplineSurface.BySphereBestFit_img.jpg)
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ internal void InsertGraph()
{
if (GraphPath != null)
{
var graphName = CurrentPackageName ?? Path.GetFileNameWithoutExtension(GraphPath);
var graphName = string.IsNullOrEmpty(CurrentPackageName) ? Path.GetFileNameWithoutExtension(GraphPath) : CurrentPackageName;
raiseInsertGraph(this, new InsertDocumentationLinkEventArgs(GraphPath, graphName));
}
else
Expand Down
108 changes: 108 additions & 0 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4106,6 +4106,103 @@
</Border>
</Popup>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentPresenter" Property="TextBlock.Opacity" Value="0.5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ContentPresenter" Property="TextBlock.Foreground" Value="White" />
<Setter TargetName="dockPanel" Property="Background" Value="{StaticResource GenericMouseOverBackgroundColorBrush}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter TargetName="dockPanel" Property="Background" Value="{StaticResource NodeContextMenuBackground}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="checkBox" Property="Visibility" Value="Visible" />
<Setter TargetName="ContentPresenter" Property="TextBlock.FontFamily" Value="{StaticResource ArtifaktElementBold}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- This context menu style is similar to the ContextMenuItemStyle and the only difference is the background at IsMouseOve = False -->
<Style x:Key="DarkContextMenuItemStyle" TargetType="{x:Type MenuItem}" BasedOn="{StaticResource ContextMenuItemStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<DockPanel x:Name="dockPanel"
HorizontalAlignment="Stretch"
Background="Transparent"
SnapsToDevicePixels="true">
<Label x:Name="checkBox"
Margin="0,0,-20,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content=""
DockPanel.Dock="Left"
FontSize="9px"
Foreground="{StaticResource PreferencesWindowButtonColor}"
Visibility="Collapsed" />
<ContentPresenter x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
VerticalAlignment="Center"
ContentSource="Header"
DockPanel.Dock="Left"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextBlock.Foreground="{StaticResource NodeContextMenuForeground}" />
<Label x:Name="subMenuArrow"
Margin="0,0,15,7"
Padding="0"
VerticalAlignment="Center"
Content="&gt;"
DockPanel.Dock="Right"
FontFamily="{StaticResource ArtifaktElementRegular}"
FontSize="13px"
Foreground="{StaticResource Blue300Brush}">
<Label.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1.5" />
</Label.RenderTransform>
<Label.Style>
<Style TargetType="{x:Type Label}">
<Setter Property="Visibility" Value="Hidden" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuItem}}, Path=HasItems}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
<Popup x:Name="PART_Popup"
AllowsTransparency="true"
Focusable="false"
HorizontalOffset="0"
IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
Placement="Right"
VerticalOffset="-2">
<Border Background="{TemplateBinding Background}"
BorderBrush="Transparent"
BorderThickness="0">
<ScrollViewer x:Name="SubMenuScrollViewer"
CanContentScroll="true"
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
TypeInTargetAssembly={x:Type FrameworkElement}}}">
<Grid RenderOptions.ClearTypeHint="Enabled">
<ItemsPresenter x:Name="ItemsPresenter"
Grid.IsSharedSizeScope="true"
KeyboardNavigation.DirectionalNavigation="Cycle"
KeyboardNavigation.TabNavigation="Cycle"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</ScrollViewer>
</Border>
</Popup>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentPresenter" Property="TextBlock.Opacity" Value="0.5" />
Expand Down Expand Up @@ -4274,6 +4371,17 @@
</Style.Resources>
</Style>

<Style x:Key="DarkContextMenuStyle" TargetType="{x:Type ContextMenu}" BasedOn="{StaticResource ContextMenuStyle}">
<Style.Resources>
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}"
BasedOn="{StaticResource ContextMenuSeparatorStyle}"
TargetType="Separator" />
<Style x:Key="{x:Type MenuItem}"
BasedOn="{StaticResource DarkContextMenuItemStyle}"
TargetType="MenuItem" />
</Style.Resources>
</Style>

<Style x:Key="MenuExpanderStyle" TargetType="Expander">
<Setter Property="Background" Value="{StaticResource SecondaryGray}" />
<Setter Property="Foreground" Value="{StaticResource PreferencesWindowFontColor}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private void DropDownInstallButton_OnClick(object sender, RoutedEventArgs e)
commandParameterBinding.Source = button.DataContext;

var contextMenuStyle = new Style(typeof(ContextMenu));
contextMenuStyle.BasedOn = (Style)SharedDictionaryManager.DynamoModernDictionary["ContextMenuStyle"];
contextMenuStyle.BasedOn = (Style)SharedDictionaryManager.DynamoModernDictionary["DarkContextMenuStyle"];

//Apply the Style to the ContextMenu
contextMenu.Style = contextMenuStyle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<ContextMenu Width="Auto"
MinWidth="180"
Background="{StaticResource GenericBorderBackgroundColorBrush}"
Style="{StaticResource ContextMenuStyle}">
Style="{StaticResource DarkContextMenuStyle}">

<!-- Sub-Title 'SORT BY' -->
<Separator>
Expand All @@ -152,6 +152,7 @@
<!-- Sort By Package Name -->
<MenuItem Command="{Binding Path=SetSortingKeyCommand}"
CommandParameter="Name"
Style="{StaticResource DarkContextMenuItemStyle}"
Header="{x:Static p:Resources.PackageSearchViewContextMenuSortByName}"
IsCheckable="True"
IsChecked="{Binding Path=SortingKey, Converter={StaticResource EnumToBoolConverter}, ConverterParameter=Name, Mode=TwoWay}" />
Expand Down Expand Up @@ -254,9 +255,9 @@
DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Mode=Self}}"
DisplayMemberPath="FilterName"
StaysOpen="True"
Style="{StaticResource ContextMenuStyle}">
Style="{StaticResource DarkContextMenuStyle}">
<ContextMenu.Resources>
<Style BasedOn="{StaticResource ContextMenuItemStyle}" TargetType="{x:Type MenuItem}">
<Style BasedOn="{StaticResource DarkContextMenuItemStyle}" TargetType="{x:Type MenuItem}">
<Setter Property="IsCheckable" Value="True" />
<Setter Property="StaysOpenOnClick" Value="True" />
<Setter Property="Command" Value="{Binding FilterCommand}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
MinWidth="180"
Width="Auto"
Background="{StaticResource NodeContextMenuBackground}"
Style="{StaticResource ContextMenuStyle}">
Style="{StaticResource DarkContextMenuStyle}">

<!-- Sub-Title 'SORT BY' -->
<Separator>
Expand Down Expand Up @@ -315,9 +315,9 @@
DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Mode=Self}}"
DisplayMemberPath="FilterName"
ItemsSource="{Binding HostFilter}"
Style="{StaticResource ContextMenuStyle}">
Style="{StaticResource DarkContextMenuStyle}">
<ContextMenu.ItemContainerStyle>
<Style BasedOn="{StaticResource ContextMenuItemStyle}" TargetType="{x:Type MenuItem}">
<Style BasedOn="{StaticResource DarkContextMenuItemStyle}" TargetType="{x:Type MenuItem}">
<Setter Property="IsCheckable" Value="True" />
<Setter Property="Command" Value="{Binding FilterCommand}" />
<Setter Property="CommandParameter" Value="{Binding FilterName}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
</Grid>

<!-- Template for the feedback banner -->
<DockPanel Name="Feedback" VerticalAlignment="Bottom" Grid.Row="4" Width="600">
<DockPanel Name="Feedback" VerticalAlignment="Bottom" Grid.Row="4" Width="Auto">
<!-- Restart Banner -->
<StatusBar
Name="RestartBanner"
Expand All @@ -468,7 +468,7 @@
<!-- Preview text -->
<StatusBarItem>
<Border Height="50">
<TextBlock TextWrapping="Wrap" Width="500" Padding="10,0,10,0" FontSize="15" Foreground="White" Text="{x:Static w:Resources.RestartBannerMessage}" VerticalAlignment="Center"/>
<TextBlock TextWrapping="Wrap" MinWidth="350" Padding="10,0,10,0" FontSize="15" Foreground="White" Text="{x:Static w:Resources.RestartBannerMessage}" VerticalAlignment="Center"/>
</Border>
</StatusBarItem>
</StatusBar>
Expand Down
35 changes: 29 additions & 6 deletions src/setnpmreg.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
If ((Test-Connection art-bobcat.autodesk.com).PingSucceeded){
echo adsk reachable
New-Item -Path . -Name ".npmrc" -ItemType "file" -Value "registry=https://npm.autodesk.com/artifactory/api/npm/autodesk-npm-virtual/" -Force
# This script checks if the adsk network is reachable
# and creates .npmrc file with appropriate value for the npm registry

$npmRegistry = "https://registry.npmjs.org"
$adskNpmRegistry = "https://npm.autodesk.com/artifactory/api/npm/autodesk-npm-virtual/"

function createNpmrcFile {
param (
[Parameter(Mandatory = $true)][string]$registry
)
Write-Host "Creating .npmrc file with registry=$registry" -ForegroundColor Blue
New-Item -Path . -Name ".npmrc" -ItemType "file" -Value "registry=$registry" -Force
}
else{
echo adsk not reachable
New-Item -Path . -Name ".npmrc" -ItemType "file" -Value "registry=https://registry.npmjs.org" -Force

try {
Write-Host "Checking if adsk npm registry is reachable..." -ForegroundColor Blue
$response = Invoke-WebRequest -Uri $adskNpmRegistry -TimeoutSec 20 -ErrorAction Stop

if ($response.StatusCode -eq 200) {
Write-Host "adsk npm registry is reachable" -ForegroundColor Green
createNpmrcFile -registry $adskNpmRegistry
}
else {
Write-Host "adsk npm registry is not reachable" -ForegroundColor Red
createNpmrcFile -registry $npmRegistry
}
}
catch {
Write-Host "adsk npm registry is not reachable" -ForegroundColor Red
createNpmrcFile -registry $npmRegistry
}
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,13 @@ public void AddGraphInSpecificLocationToWorkspace()
//Validates that we have 5 nodes the CurrentWorkspace (after the graph was added)
Assert.AreEqual(ViewModel.Model.CurrentWorkspace.Nodes.Count(), 5);
DispatcherUtil.DoEvents();

//Validates that we have 1 group added containing the inserted graph
Assert.AreEqual(ViewModel.Model.CurrentWorkspace.Annotations.Count(), 1);

//Validates that correct group name and description was set
Assert.AreEqual(ViewModel.Model.CurrentWorkspace.Annotations.FirstOrDefault().AnnotationText, "BasicAddition");
Assert.AreEqual(ViewModel.Model.CurrentWorkspace.Annotations.FirstOrDefault().AnnotationDescriptionText, "Inserted Dynamo graph");
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Define Data - Documentation
## In Depth
In the example below, a planar T-Spline surface with extruded, subdivided and pulled vertices and faces is inspected with the `TSplineTopology.InnerVertices` node.

This documentation file is auto generated by NodeDocumentationMarkdownGenerator, Version=2.13.0.2212, Culture=neutral, PublicKeyToken=null.
The nodes `TSplineVertex.UVNFrame` and `TSplineUVNFrame.Position` are used to highlight the inner vertices in the surface.
___
## Example File

For more information about adding documentation to nodes see https://github.com/DynamoDS/Dynamo/wiki/Create-and-Add-Custom-Documentation-to-Nodes
![TSplineTopology.InnerVertices](./Autodesk.DesignScript.Geometry.TSpline.TSplineTopology.InnerVertices_img.jpg)

0 comments on commit 22887ee

Please sign in to comment.