Skip to content

Commit 6d89d72

Browse files
mjkkirschnerDynamoEngOpssaintentropyaparajit-pratapQilongTang
authored
Helix upgrade mastermerge (#10465)
* LibG Binaries Update (#10295) * "LibG/ASM224,7418555f" * "LibG/ASM224.4,918b3d73" * "LibG/ASM225,2b68d3dd" * "LibG/ASM226,2b308956" * Change mechanism to retreive the certificate from assembly (#10301) * DYN-2225 - Marshaling Performance optimization - Heap Cleanup (#10026) * fast path for zero size heap allocation * Cache mechanism for marshalling lookups * Do not allocate heap stack values for class properties for CLR objects * Test removing getter heap interaction for CLR object * Remove unused Heap Object set * make variables non-static * remove GetterFunctionPointer class Co-authored-by: aparajit-pratap <[email protected]> * DYN-2289: Fix crash with NodeToCode (#10305) * search for property by getter if not found * add test * Geometry Color Tests More (#10291) * Add geometry color check for Display_ByGeometryColor_HasColoredMesh Add geometry color check for Display_ByGeometryColor_HasColoredMesh * Test updates * Add Geometry Transparency Test * Update test name * update newly added test (#10313) * DYN-2286: fix for crash upon unresolved node undo (#10315) * fix for crash upon unresolved node undo * override Equals in PortModel * add recorded test * DYN-2328 Add test for geometry labeling (#10311) * DYN-2328 Add test for geometry lablling * DYN-2328 Add test for geometry labeling * Removing extra assignments * updating the test and the test dyn file. * Removing the extra variable that is not being used * First Github Action (#10131) This Github Action will greet Github users who submit a PR or issue first time to our repo * Removal of PR trigger for now (#10323) * Analytics Agreement Workflow Update (#10314) * Initial Commit to Update Analytics Agreement Workflow * update * Add unit test for deserializing analytics setting * Update instrumentation default agreement setting in unit test * Add more comments * Add missing resource string (#10329) * LibG Binaries Update (#10331) * "LibG/ASM224,7418555f" * "LibG/ASM224.4,918b3d73" * "LibG/ASM225,2b68d3dd" * "LibG/ASM226,5c8f1fdd" * Fix the library view display issues introduced by MS WebBrowser (#10316) * Disable the context menu on the library viewer. * Zoom the libarary view to adapt the current DPI scale. * Disable the horizontal scroll bar on the bottom of the library view. * Disable the library view is zoomed by keyboard or mouse wheel. * Zoom the library bar to adapt the current DPI scale. * Hide the extra search text bar close button. * [DYN-2382] LibraryViewExtensionMSWebBrowser does not scale correctly when using display scaling (#10335) * Disable the context menu on the library viewer. * Zoom the libarary view to adapt the current DPI scale. * Disable the horizontal scroll bar on the bottom of the library view. * Disable the library view is zoomed by keyboard or mouse wheel. * Zoom the library bar to adapt the current DPI scale. * Hide the extra search text bar close button. * Unsubscribing the event handler in dispose method * Skip GA Client Tear Down Process if NOT Necessary (#10340) * Skip Analytics Client Tear down if it is not needed * Add unit test covering analytics tear down * Touch test naming * [Analytics] Update Tracking Conditions (#10345) * Update Tracking Conditions * Add same check to ReportingUsage * Add properties comments * PR comment (#10347) * Code improvements: (#10348) 1. Unsubscribe DpiChanged event handler in the browser Dispose method. 2. Move the overflow-x style setting from script to html to avoid to set it when the script method is called every time. 3. Add necessary comments. * add show line numbers when watermarkLabel is collapsed (#10362) * Visual Identifier on Optional Inputs (#10361) * change port text to italic if using default input * Update Ports.xaml * Update README.md (#10387) * Update README.md * Update README.md * Update README.md * Update DynamoVisualProgramming.Core.nuspec * Update DynamoVisualProgramming.Core.nuspec * GA client not launching when terms not agreed (#10407) * GA client not launching when terms not agreed * Comments * Patch 283 (#10421) * Add WinVerityTrust wrapper * Utilzie new WinTrustWrapper method for cert verification * Add negative test * Add Package with faked certificate * Create sub namespace for WinVerityInteropp * Update the WinTrustInterop * Upate method call name * Add specific exceptions to the CertificateVerfication class * formating * Cover Test for Configuration Folder (#10444) * Cover Test for Configuration Folder * Update DynamoCoreTests.csproj * Added a couple of asserts for the properties. (#10437) * Add Test for Properties and removed getter and setter from WorkspaceDependencyViewExtension.DependencyView property. * Update WorkspaceDependencyViewExtension.cs * Fix for crash while drawing Point manipulator (gizmo) when LibG fails to load (#10148) * fix for crash in DM when LibG fails to load * return from recursive loop once we find the first non-null point * cache enabled flag for manipulator * more fixes * add documentation * add documentation Co-authored-by: DynamoEngOps <[email protected]> Co-authored-by: Craig Long <[email protected]> Co-authored-by: aparajit-pratap <[email protected]> Co-authored-by: Aaron (Qilong) <[email protected]> Co-authored-by: reddyashish <[email protected]> Co-authored-by: StarLee <[email protected]> Co-authored-by: Sylvester Knudsen <[email protected]>
1 parent 9d5917d commit 6d89d72

File tree

19 files changed

+506
-48
lines changed

19 files changed

+506
-48
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Looking to learn or download Dynamo? Check out [dynamobim.org](http://dynamobim
1414
If you're interested in developing a Node library for Dynamo, the easiest place to start is by browsing the [DynamoSamples](https://github.com/DynamoDS/DynamoSamples).
1515
These samples use the [Dynamo NuGet packages](https://www.nuget.org/packages?q=DynamoVisualProgramming) which can be installed using the NuGet package manager in Visual Studio.
1616

17-
[Documentation of the Dynamo API]( http://dynamods.github.io/DynamoAPI) with a searchable index of public API calls for core functionality. This will be expanded to include regular nodes and Revit functionality.
17+
[Documentation of the Dynamo API via Fuget.org]( https://www.fuget.org/packages/DynamoVisualProgramming.Core/2.5.0.7432) with a searchable index of public API calls for core functionality in the dynamo nuget packages. *WIP*.
18+
#### note: link may change in the near future.
1819

1920
The [API Changes](https://github.com/DynamoDS/Dynamo/wiki/API-Changes) document explains changes made to the Dynamo API with every version.
2021

src/DynamoCore/Models/DynamoModel.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,11 @@ protected DynamoModel(IStartConfiguration config)
594594
PreferenceSettings = settings;
595595
PreferenceSettings.PropertyChanged += PreferenceSettings_PropertyChanged;
596596
}
597-
598-
InitializeInstrumentationLogger();
597+
// If user does not agree to GA terms, do not try to launch the client at all
598+
if (PreferenceSettings.IsAnalyticsReportingApproved)
599+
{
600+
InitializeInstrumentationLogger();
601+
}
599602

600603
if (!IsTestMode && PreferenceSettings.IsFirstRun)
601604
{

src/DynamoCoreWpf/Rendering/HelixRenderPackage.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public HelixRenderPackage()
7979
/// Set the transform that is applied to all geometry in the renderPackage.
8080
/// </summary>
8181
/// <param name="transform"></param>
82+
// TODO: Unused method. Adds unnecessary dependency on ProtoGeometry. Remove in 3.0
83+
[Obsolete("This method will be removed in 3.0. Use SetTransform(double[] matrix) instead.")]
8284
public void SetTransform(Autodesk.DesignScript.Geometry.CoordinateSystem transform)
8385
{
8486
var xaxis = transform.XAxis;
@@ -95,12 +97,15 @@ public void SetTransform(Autodesk.DesignScript.Geometry.CoordinateSystem transfo
9597
this.Transform = csAsMat.ToArray();
9698
}
9799

100+
98101
/// <summary>
99102
/// Set the transform that is applied to all geometry in the renderPackage
100103
/// by computing the matrix that transforms between from and to.
101104
/// </summary>
102105
/// <param name="from"></param>
103106
/// <param name="to"></param>
107+
// TODO: Unused method. Adds unnecessary dependency on ProtoGeometry. Remove in 3.0
108+
[Obsolete("This method will be removed in 3.0.")]
104109
public void SetTransform(Autodesk.DesignScript.Geometry.CoordinateSystem from, Autodesk.DesignScript.Geometry.CoordinateSystem to)
105110
{
106111
var inverse = from.Inverse();
@@ -149,8 +154,14 @@ public void SetTransform(double m11, double m12, double m13, double m14,
149154

150155
/// <summary>
151156
/// Set the transform as a double array, this transform is applied to all geometry in the renderPackage.
152-
/// NOTE: this matrix is assumed to be in row vector form, and will be transformed into the neccesary form
153-
/// for helix
157+
/// This matrix should be laid out as follows in row vector order:
158+
/// [Xx,Xy,Xz, 0,
159+
/// Yx, Yy, Yz, 0,
160+
/// Zx, Zy, Zz, 0,
161+
/// offsetX, offsetY, offsetZ, W]
162+
/// NOTE: This method should transform the matrix from row vector order to whatever form is needed by the implementation.
163+
/// When converting from ProtoGeometry CoordinateSystem form to input matrix, set the first row to the X axis of the CS,
164+
/// the second row to the Y axis of the CS, the third row to the Z axis of the CS, and the last row to the CS origin, where W = 1.
154165
/// </summary>
155166
/// <param name="matrix"></param>
156167
public void SetTransform(double[] matrix)

src/DynamoCoreWpf/UI/Themes/Modern/Ports.xaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
</Rectangle>
137137

138138
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
139-
<TextBlock Name="portNameTb"
139+
<TextBlock Name="portNameTb"
140140
Width="Auto"
141141
HorizontalAlignment="Stretch"
142142
Style="{StaticResource SZoomFadeText}"
@@ -148,6 +148,20 @@
148148
IsHitTestVisible="False"
149149
Background="{x:Null}"
150150
Foreground="#555555">
151+
<TextBlock.Style>
152+
<Style TargetType="TextBlock">
153+
<Style.Triggers>
154+
<DataTrigger Binding="{Binding UsingDefaultValue}" Value="True">
155+
<Setter Property="FontStyle"
156+
Value="Italic" />
157+
</DataTrigger>
158+
<DataTrigger Binding="{Binding UsingDefaultValue}" Value="False">
159+
<Setter Property="FontStyle"
160+
Value="Normal" />
161+
</DataTrigger>
162+
</Style.Triggers>
163+
</Style>
164+
</TextBlock.Style>
151165
</TextBlock>
152166
<!-- We wrap the text block in a grid so that it wont be displayed on output port-->
153167
<Grid Visibility="{Binding Path=UseLevelVisibility}" HorizontalAlignment="Right">

src/DynamoCoreWpf/Views/CodeCompletion/CodeCompletionEditor.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ private IEnumerable<CodeCompletionInsightItem> GetFunctionSignatures(string code
184184
private void OnTextChanged(object sender, EventArgs e)
185185
{
186186
if (WatermarkLabel.Visibility == Visibility.Visible)
187+
{
187188
WatermarkLabel.Visibility = Visibility.Collapsed;
189+
InnerTextEditor.ShowLineNumbers = true;
190+
}
188191
}
189192

190193
private void OnTextAreaTextEntering(object sender, TextCompositionEventArgs e)

src/DynamoManipulation/NodeManipulator.cs

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,31 @@ internal IRenderPackageFactory RenderPackageFactory
8888
}
8989

9090
internal Point3D? CameraPosition { get; private set; }
91+
92+
// This is null for each new manipulator that is initialized.
93+
private bool? isValidNode;
94+
95+
/// <summary>
96+
/// This property is true if the cached value of the manipulator node is non-null.
97+
/// It caches its value so that it doesn't have to repeatedly query the node value.
98+
/// NOTE: There could be edge cases where the node value could become null while the
99+
/// manipulator is being moved, etc. These cases will not be caught and the boolean
100+
/// value returned would be true even though it should change to false. This case could
101+
/// lead to a potential crash and is yet to be addressed.
102+
/// </summary>
103+
private bool IsValidNode
104+
{
105+
get
106+
{
107+
if (isValidNode == null)
108+
{
109+
isValidNode = !IsNodeNull(Node.CachedValue);
110+
}
111+
112+
return (bool) isValidNode;
113+
}
114+
115+
}
91116

92117
#endregion
93118

@@ -154,7 +179,8 @@ protected virtual void Dispose(bool disposing)
154179
/// <param name="mouseButtonEventArgs"></param>
155180
protected virtual void MouseDown(object sender, MouseButtonEventArgs mouseButtonEventArgs)
156181
{
157-
182+
if (!IsValidNode) return;
183+
158184
active = UpdatePosition();
159185

160186
GizmoInAction = null; //Reset Drag.
@@ -430,7 +456,7 @@ private RenderPackageCache GenerateRenderPackages()
430456

431457
// This check is required as for some reason LibG fails to load, geometry nodes are null
432458
// and we must return immediately before proceeding with further calls to ProtoGeometry
433-
if (IsNodeValueNull()) return packages;
459+
if (IsNodeNull(Node.CachedValue)) return packages;
434460

435461
AssignInputNodes();
436462

@@ -551,28 +577,47 @@ public RenderPackageCache BuildRenderPackage()
551577
return packages;
552578
}
553579

580+
#endregion
581+
554582
/// <summary>
555583
/// Checks if manipulator is enabled or not. Manipulator is enabled
556-
/// only if node is not frozen or not setup as partially applied function
584+
/// only if node is not frozen, its preview visible and value non-null.
557585
/// </summary>
558586
/// <returns>True if enabled and can be manipulated.</returns>
559587
public bool IsEnabled()
560588
{
561589
if (Node.IsFrozen || !Node.IsVisible) return false;
562590

563-
if (IsNodeValueNull())
591+
if (!IsValidNode)
564592
{
565593
return false;
566594
}
567595

568596
return active;
569597
}
570598

599+
// TODO: Remove in 3.0
600+
[Obsolete("This method will be removed in 3.0 and will no longer be available as a public API.")]
571601
public bool IsNodeValueNull()
572602
{
573-
return Node.CachedValue == null || Node.CachedValue.IsNull;
603+
return IsNodeNull(Node.CachedValue);
604+
}
605+
606+
private static bool IsNodeNull(MirrorData data)
607+
{
608+
if (data == null || data.IsNull) return true;
609+
610+
if (data.IsCollection)
611+
{
612+
var elements = data.GetElements();
613+
foreach (var element in elements)
614+
{
615+
if (IsNodeNull(element)) return true;
616+
}
617+
}
618+
619+
return false;
574620
}
575-
#endregion
576621
}
577622

578623

0 commit comments

Comments
 (0)