Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Browse files Browse the repository at this point in the history
  • Loading branch information
zeusongit committed Oct 21, 2024
2 parents b8491a5 + e2f6813 commit afdc57c
Show file tree
Hide file tree
Showing 58 changed files with 4,302 additions and 2,248 deletions.
8 changes: 6 additions & 2 deletions src/Config/CS_SDK.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@
<DebugSymbols>true</DebugSymbols>
<SelfContained>false</SelfContained>
</PropertyGroup>
<PropertyGroup>
<DebugType>full</DebugType>
<!--generate windows pdbs on windows and portable pdbs for linux builds - CER currently does not support portable-->
<PropertyGroup Condition="!$(Platform.Contains('Linux'))">
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="$(Platform.Contains('Linux'))" >
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug' ">
<Optimize>false</Optimize>
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCore/DynamoCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup Label="Common dependencies">
<PackageReference Include="Autodesk.IDSDK" Version="1.2.4" />
<PackageReference Include="Greg" Version="3.0.2.6284" />
<PackageReference Include="Greg" Version="3.0.2.6533" />
<PackageReference Include="DynamoVisualProgramming.LibG_230_0_0" Version="3.0.0.6246" GeneratePathProperty="true" />
<PackageReference Include="DynamoVisualProgramming.LibG_231_0_0" Version="3.4.0.2734" GeneratePathProperty="true" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" CopyXML="true" />
Expand Down
14 changes: 14 additions & 0 deletions src/DynamoCore/Graph/Nodes/NodeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,20 @@ protected NodeModel(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPo
RaisesModificationEvents = true;
}

/// <summary>
/// The method returns the assembly name from which the node originated.
/// </summary>
/// <returns>Assembly Name</returns>
internal virtual AssemblyName GetNameOfAssemblyReferencedByNode()
{
AssemblyName assemblyName = null;

var assembly = this.GetType().Assembly;
assemblyName = AssemblyName.GetAssemblyName(assembly.Location);

return assemblyName;
}

/// <summary>
/// Here we try to find the correct port names and tooltips.
/// ideally we'd use the runtime information to correctly update or localize
Expand Down
21 changes: 20 additions & 1 deletion src/DynamoCore/Graph/Nodes/ZeroTouch/DSFunctionBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Xml;
using Dynamo.Engine;
using Dynamo.Engine.CodeGeneration;
Expand Down Expand Up @@ -76,6 +77,24 @@ public override IdentifierNode GetAstIdentifierForOutputIndex(int outputIndex)
}
}

/// <summary>
/// The method returns the assembly name from which the node originated.
/// Only if the node was added from a package
/// </summary>
/// <returns>Assembly Name</returns>
internal override AssemblyName GetNameOfAssemblyReferencedByNode()
{
AssemblyName assemblyName = null;

var descriptor = this.Controller.Definition;
if (descriptor.IsPackageMember)
{
assemblyName = AssemblyName.GetAssemblyName(descriptor.Assembly);
}

return assemblyName;
}

/// <summary>
/// Copy command will call it to serialize this node to xml data.
/// </summary>
Expand Down Expand Up @@ -358,4 +377,4 @@ protected override AssociativeNode GetFunctionApplication(NodeModel model, List<
return rhs;
}
}
}
}
2 changes: 1 addition & 1 deletion src/DynamoCore/Graph/Workspaces/WorkspaceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ internal PackageInfo GetNodePackage(NodeModel node)
throw new Exception("There are multiple subscribers to Workspace.CollectingNodePackageDependencies. " +
"Only PackageManagerExtension should subscribe to this event.");
}
var assemblyName = GetNameOfAssemblyReferencedByNode(node);
var assemblyName = node.GetNameOfAssemblyReferencedByNode();
if (assemblyName != null)
{
return CollectingNodePackageDependencies(assemblyName);
Expand Down
13 changes: 11 additions & 2 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1472,11 +1472,18 @@ private void InitializeCustomNodeManager()
var customNodeSearchRegistry = new HashSet<Guid>();
CustomNodeManager.InfoUpdated += info =>
{
//just bail in service mode.
if (IsServiceMode)
{
return;
}

if (customNodeSearchRegistry.Contains(info.FunctionId)
|| !info.IsVisibleInDynamoLibrary)
return;

var elements = SearchModel.Entries.OfType<CustomNodeSearchElement>().

var elements = SearchModel?.Entries.OfType<CustomNodeSearchElement>().
Where(x =>
{
// Search for common paths and get rid of empty paths.
Expand All @@ -1494,6 +1501,7 @@ private void InitializeCustomNodeManager()
}
return;
}


customNodeSearchRegistry.Add(info.FunctionId);
var searchElement = new CustomNodeSearchElement(CustomNodeManager, info);
Expand Down Expand Up @@ -1530,6 +1538,7 @@ private void InitializeCustomNodeManager()
}
};
};

CustomNodeManager.DefinitionUpdated += UpdateCustomNodeDefinition;
}

Expand Down Expand Up @@ -2807,7 +2816,7 @@ internal void DumpLibraryToXml(object parameter)
string fileName = String.Format("LibrarySnapshot_{0}.xml", DateTime.Now.ToString("yyyyMMddHmmss"));
string fullFileName = Path.Combine(pathManager.LogDirectory, fileName);

SearchModel.DumpLibraryToXml(fullFileName, PathManager.DynamoCoreDirectory);
SearchModel?.DumpLibraryToXml(fullFileName, PathManager.DynamoCoreDirectory);

Logger.Log(string.Format(Resources.LibraryIsDumped, fullFileName));
}
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCore/Utilities/LuceneSearchUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ internal string CreateSearchQuery(string[] fields, string SearchTerm, bool IsPac
foreach (string s in searchTerm.Split(' '))
{
//If is a ByEmptySpace search and the split words match with more than MaxNodeNamesRepeated nodes then the word is skipped (otherwise the results will be polluted with hundred of not related nodes)
int nodesFrequency = dynamoModel.SearchModel.Entries.Where(entry => entry.Name.ToLower().Contains(s) && !string.IsNullOrEmpty(s)).Count();
int? nodesFrequency = dynamoModel.SearchModel?.Entries.Where(entry => entry.Name.ToLower().Contains(s) && !string.IsNullOrEmpty(s)).Count();
if (nodesFrequency > MaxNodeNamesRepeated) continue;

if (string.IsNullOrEmpty(s)) continue;
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<PackageReference Include="DynamoVisualProgramming.LibG_231_0_0" Version="3.4.0.2734"/>
<PackageReference Include="FontAwesome5" Version="2.1.11" />
<PackageReference Include="AvalonEdit" Version="6.3.0.90" CopyXML="true" />
<PackageReference Include="Greg" Version="3.0.2.6284" />
<PackageReference Include="Greg" Version="3.0.2.6533" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2478.35" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="RestSharp" Version="112.0.0" />
Expand Down
145 changes: 110 additions & 35 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

Loading

0 comments on commit afdc57c

Please sign in to comment.