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-6633: Definedata hierarchy #15154

Merged
merged 50 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3785210
initialize definedata model
dnenov Feb 5, 2024
93c4741
added test structure, node customization
dnenov Feb 20, 2024
9c07a73
hierarchical container, geometry tests
dnenov Feb 28, 2024
2bc7903
primitive tests done
dnenov Feb 28, 2024
1621855
ggroup
zeusongit Feb 28, 2024
33a522c
Revert "ggroup"
zeusongit Feb 28, 2024
b92a8d0
inheritance tests done
dnenov Feb 29, 2024
1d843d8
Merge remote-tracking branch 'upstream/master' into definedata-initial
dnenov Feb 29, 2024
49130b6
comments
dnenov Feb 29, 2024
8cb3a41
finished refactoring for tests
dnenov Mar 5, 2024
6761fe4
Merge remote-tracking branch 'upstream/master' into definedata-initial
dnenov Mar 5, 2024
cfd197e
refactor, comments
dnenov Mar 7, 2024
a2b023a
pass through
dnenov Mar 7, 2024
0dd95d3
inputs
dnenov Mar 12, 2024
d5d2f81
added hierarchy
dnenov Mar 12, 2024
3670a60
raw throws, onnodemodified
dnenov Mar 14, 2024
7335336
node resources
dnenov Mar 15, 2024
cf5887c
visual hierarchy
dnenov Mar 15, 2024
9e01e51
Merge remote-tracking branch 'upstream/master' into definedata-view
dnenov Mar 15, 2024
3ff098c
Merge remote-tracking branch 'upstream/master' into definedata-view
dnenov Mar 15, 2024
fa342c0
First pass
saintentropy Mar 19, 2024
7b5fe80
Add more comments
saintentropy Mar 19, 2024
f0428ac
Fix angry VM
saintentropy Mar 19, 2024
244e975
comments
dnenov Mar 19, 2024
8790a75
Merge pull request #2 from saintentropy/AddPlayerSetValue2
dnenov Mar 19, 2024
69ac4c4
don't throw if no input
dnenov Mar 19, 2024
2dc0f47
Merge branch 'definedata-view' into definedata-hierarchy
dnenov Mar 19, 2024
acbbef0
added 'select types' handling
dnenov Mar 20, 2024
8a4095e
node tests started
dnenov Mar 20, 2024
f689c16
Merge remote-tracking branch 'upstream/master' into definedata-view
dnenov Mar 20, 2024
a25b667
datatype list refactor
dnenov Mar 20, 2024
b0c46e4
comments
dnenov Mar 20, 2024
19c565b
Merge remote-tracking branch 'upstream/master' into definedata-view
dnenov Mar 20, 2024
3d029c9
Merge remote-tracking branch 'upstream/master' into definedata-view
dnenov Mar 22, 2024
98446b2
Merge remote-tracking branch 'upstream/master' into definedata-hierarchy
dnenov Apr 5, 2024
b2029d5
Merge branch 'definedata-view' into definedata-hierarchy
dnenov Apr 5, 2024
5da7e89
list handling in AutoMode
dnenov Apr 7, 2024
61fd8fc
resources update
dnenov Apr 8, 2024
e47fec3
Merge remote-tracking branch 'upstream/master' into definedata-hierarchy
dnenov Apr 17, 2024
9797db1
node lock on interaction
dnenov Apr 17, 2024
1b619f7
interaction adjustment, dynamoPlayer fix
dnenov Apr 18, 2024
395bd21
Merge remote-tracking branch 'upstream/master' into definedata-hierarchy
dnenov Apr 19, 2024
be4c558
api additions
dnenov Apr 19, 2024
50a876b
Merge remote-tracking branch 'upstream/master' into definedata-hierarchy
dnenov Apr 25, 2024
914b793
moved test to visualization tests
dnenov Apr 26, 2024
ef49bf5
Merge remote-tracking branch 'upstream/master' into definedata-hierarchy
dnenov Apr 26, 2024
c30f0bb
Revise help file
twastvedt May 7, 2024
e458549
Revise comment
twastvedt May 7, 2024
fc2de6a
Text tweaks
twastvedt May 8, 2024
118b267
Merge pull request #3 from twastvedt/definedata-hierarchy
dnenov May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion doc/distrib/NodeHelpFiles/CoreNodeModels.DefineData.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
## In Depth

Validates and returns data from a currently or previously connected input node.
The Define Data Node is designed to work as in input node, while validating the data type of the incoming data (type can be 'string', 'point', 'boolean' or any data type that is currently supported by Dynamo. For the full list of supported data types, expand the Dropdown menu of the node). It uses upstream nodes to set default values to make setting the type data easier as well as making the graphs functional when the nodes are used.

The node has 4 inputs:
- the node '**>**' Input - can be connected to any downstream node to validate the input of
- the **Dropdown** menu
- the '**List**' toggle
- the '**Lock**' toggle

The node has two distinct modes in terms of behaviour - the 'Manua' and 'Auto' mode. This are defined by the state of the 'Lock' toggle - locked is for 'Manual', whereas unlocked is for 'Auto' mode.

### Manual mode

Set the **Lock** to locked position. The user sets the type of data explicitly by interacting with the **Dropdown** and **List** toggle. The node validates the data. If the validation is successful, the output of the node is the same as the input. If the validation is not successful, the node will enter a **Warning** state with a null output.

### Auto mode

Set the **Lock** to unlocked position. The downstream data is being automaticall validated. If the type of data is valid*, the node will automatically adjust the **Dropdown** and **List** toggles to match the input data type. If the validation process is successful, the output of the node is the same as the input. If the validation process is not successful, the node will enter a **Warning** state with a null output.

* data validity - the data is recognized by Dynamo (any of the **Dropdown** menu values) and the data is either a single objet or a List of homogeneous values, or a List of values that belong to the same hierarchical tree.

In the example below, the first group of 'DefineData' nodes is in 'Manual' 'single value' mode - the node correctly validates the Number input provided, while rejecting the String input. The second group showscases a node in 'Auto' mode - the node automatically adjusts the 'Dropdown' and 'List' toggles to the desired inputs - in this case, list of integers.

---

## Example File

![Define_Data](./CoreNodeModels.DefineData_img.jpg)

3 changes: 3 additions & 0 deletions src/DynamoCore/Engine/EngineController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ private bool VerifyGraphSyncData(IEnumerable<NodeModel> nodes)
{
if (!node.IsInputNode) continue;

//We also don't want any nodes that do have input ports or where derived from custom nodes.
if (node.InPorts.Any() || node.IsCustomFunction) continue;

twastvedt marked this conversation as resolved.
Show resolved Hide resolved
// Only one or the other of the two lists, Added or Modified, will match the node GUID if they do.
bool isAdded = false;
for (int i = 0; i < graphSyncdata.AddedSubtrees.Count; i++)
Expand Down
18 changes: 18 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.

10 changes: 9 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3962,6 +3962,14 @@ To make this file into a new template, save it to a different folder, then move
<data name="DynamoXmlFileFormat" xml:space="preserve">
<value>Dynamo 1.x file format</value>
</data>
<data name="DataInputNodeModeLockTooltip" xml:space="preserve">
<value>When locked, this node only accepts the selected data type as input. When unlocked, the input can be any supported data type.</value>
<comment>Tool-tip for the padlock toggle button controlling auto/manual mode.</comment>
</data>
<data name="DataInputNodeInformationTooltip" xml:space="preserve">
<value>Toggle on if the input data contains a list.</value>
<comment>Tool-tip for info questionmark icon.</comment>
</data>
<data name="MessagePackageOlderDynamo" xml:space="preserve">
<value>The package or one of its dependencies use an older version of {0} than you are currently using. Do you want to continue?</value>
</data>
Expand All @@ -3970,5 +3978,5 @@ To make this file into a new template, save it to a different folder, then move
</data>
<data name="MessagePackOlderDynamoLink" xml:space="preserve">
<value>#Learn more=https://primer2.dynamobim.org/1_developer_primer_intro/3_developing_for_dynamo/updating-your-packages-and-dynamo-libraries-for-dynamo-3x-net8</value>
</data>
</data>
</root>
10 changes: 9 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3949,6 +3949,14 @@ To make this file into a new template, save it to a different folder, then move
<data name="DynamoXmlFileFormat" xml:space="preserve">
<value>Dynamo 1.x file format</value>
</data>
<data name="DataInputNodeModeLockTooltip" xml:space="preserve">
<value>When locked, this node only accepts the selected data type as input. When unlocked, the input can be any supported data type.</value>
<comment>Tool-tip for the padlock toggle button controlling auto/manual mode.</comment>
</data>
<data name="DataInputNodeInformationTooltip" xml:space="preserve">
<value>Toggle on if the input data contains a list.</value>
<comment>Tool-tip for info questionmark icon.</comment>
</data>
<data name="MessagePackageOlderDynamo" xml:space="preserve">
<value>This package or one of its dependencies were created for a previous version of Dynamo. It may not work in this version. Do you want to continue?</value>
</data>
Expand All @@ -3958,4 +3966,4 @@ To make this file into a new template, save it to a different folder, then move
<data name="MessagePackOlderDynamoLink" xml:space="preserve">
<value>#Learn more=https://primer2.dynamobim.org/1_developer_primer_intro/3_developing_for_dynamo/updating-your-packages-and-dynamo-libraries-for-dynamo-3x-net8</value>
</data>
</root>
</root>
2 changes: 2 additions & 0 deletions src/DynamoCoreWpf/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4452,6 +4452,8 @@ static Dynamo.Wpf.Properties.Resources.CustomNodePropertyWindowName.get -> strin
static Dynamo.Wpf.Properties.Resources.CustomNodePropertyWindowNameHint.get -> string
static Dynamo.Wpf.Properties.Resources.CustomNodePropertyWindowTitle.get -> string
static Dynamo.Wpf.Properties.Resources.CustomNodeTypeShortString.get -> string
static Dynamo.Wpf.Properties.Resources.DataInputNodeInformationTooltip.get -> string
static Dynamo.Wpf.Properties.Resources.DataInputNodeModeLockTooltip.get -> string
static Dynamo.Wpf.Properties.Resources.DefaultPythonEngineNone.get -> string
static Dynamo.Wpf.Properties.Resources.DeleteFailureMessageBoxTitle.get -> string
static Dynamo.Wpf.Properties.Resources.DeprecatingPackageMessageBoxTitle.get -> string
Expand Down
Loading
Loading