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

Rename Miscellany Classes to avoid conflict with Core Nodes #14

Open
thomascorrie opened this issue Jan 15, 2019 · 5 comments
Open

Rename Miscellany Classes to avoid conflict with Core Nodes #14

thomascorrie opened this issue Jan 15, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@thomascorrie
Copy link
Owner

thomascorrie commented Jan 15, 2019

Having the same class names as Core Nodes leads to warnings and clashes when using in DesignScript. Although it can be ignored it would be better have different names and use the Miscellany_DynamoCustomization.xml to categorize in the list
misc-error

@thomascorrie thomascorrie self-assigned this Jan 15, 2019
@thomascorrie thomascorrie added the bug Something isn't working label Jan 15, 2019
@thomascorrie
Copy link
Owner Author

Referred to this documentation for setting up a migrations file or node name changes: https://github.com/DynamoDS/Dynamo/wiki/Zero-Touch-Plugin-Development#migrations

@thomascorrie
Copy link
Owner Author

Others have changed their class names to plural to avoid this
DynamoDS/Dynamo#8981 (comment)
but if I change List to Lists then I get conflicts with others who have done this, e.g. Archi-Lab
lists
I want to avoid MiscList or similar but that seems a robust way to avoid the problem

@thomascorrie
Copy link
Owner Author

I have tried various options and the least troublesome seems to be to rename classes to avoid conflict. In this first example I have focused on the geometry nodes. Instead of having a CoodinateSystem class I have amalgamated it into one Abstract class with methods named CoordinateSystemDisplay

Miscellany.Geometry.Abstract.CoordinateSystem.Display

becomes

Miscellany.Geometry.Abstract.CoordinateSystemDisplay

The downside is that the node goes from the simple name (and consistent with core Dynamo nodes) of CoordinateSystem.Display to Abstract.CoordinateSystemDisplay but I think that is the price that has to be paid to avoid class name conflicts and also names like CoordinateSystems.Display or MiscCoordinateSystem.Display

image

I have also added DynamoVisualProgramming.Core to the solution and used

[NodeCategory("Query")]

to reclassify those nodes from actions (⚡) to query (?)

Initial commit: 0872d64

@thomascorrie thomascorrie changed the title Rename Miscellany Namespaces to avoid conflict with Core Nodes Rename Miscellany Classes to avoid conflict with Core Nodes Jan 17, 2019
@thomascorrie
Copy link
Owner Author

I have completed the review of class names with the following amendments.

CoordinateSystem > Abstract
Plane > Abstract
Vector > Abstract
Functions > Maths
List > Modifies

The slight lack of consistency in naming is unfortunate but it will avoid conflicts with core nodes or other packages until a proper solution is implemented in Dynamo itself

@thomascorrie
Copy link
Owner Author

Spoke to Keith Alfaro at the London Dynamo + Generative Design Hackathon 2019 and he confirmed that you need to avoid using the same class names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant