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

Add new Combinatorics node (WIP) #2346

Merged
merged 2 commits into from
Dec 29, 2018

Conversation

DolphinDream
Copy link
Collaborator

@DolphinDream DolphinDream commented Dec 28, 2018

The combinatoric operations implemented so far (based on itertools module) are:

PRODUCT
PERMUTATIONS
COMBINATIONS

The node is vectorized and works with lists of any type.

  • Code changes complete.
  • Code documentation complete.
  • Documentation for users complete (or not required, if user never sees these changes).
  • Manual testing done.
  • Unit-tests implemented.
  • Ready for merge.

Node UI:
sv-combinatoricsnode-ui1

Product operation:
sv-combinatorics-product

note: The example shows the product of 3 different lists (numbers, strings and vertices).

Permutations operation (with vectorization):
sv-combinatorics-permutation

Combinations operation (with vectorization):
sv-combinatorics-combination

The combinatoric operations implemented so far, based on itertools module are:

PRODUCT
PERMUTATION
COMBINATION

self.outputs.new('StringsSocket', "Result")

self.operation = "PRODUCT"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already set in the EnumProperty default. If you are doing this just to trigger update_operation, just call it straight up.

- self.operation = "PRODUCT"
+ self.update_operation(context)

if you really need to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I did add the default value to the enum after I had added the above code in sv_init :)

@DolphinDream DolphinDream changed the title Add new combinatorics node (WIP) Add new Combinatorics node (WIP) Dec 28, 2018
@DolphinDream
Copy link
Collaborator Author

DolphinDream commented Dec 29, 2018

And here’s a fun application.. the node speaks fluent binary 😉

sv-combinatorics-product-binarycode

@DolphinDream
Copy link
Collaborator Author

DolphinDream commented Dec 29, 2018

And another fun (practical) application: 3D grids.

well. i’m sure there are other ways to create this ouptut... however, the real fun begins beyond 3D :) Obviously this setup can also create 4D grids (useful for the developing of the quaternions / 4D math nodes 😉 )

sv-combinatorics-3d-grid

@DolphinDream
Copy link
Collaborator Author

If there are no objections, comments, suggestions.. this node should be ready to land.

@DolphinDream
Copy link
Collaborator Author

Btw, currently the node is placed in the BETA section of the index.md... (though its node/doc file location is in List Mutator). If appropriate I can move it to the List Mutator in the index as well, unless it is recommended to keep it in beta for now until it is further beta tested by users.

@DolphinDream DolphinDream merged commit 72896c4 into nortikin:master Dec 29, 2018
@DolphinDream DolphinDream deleted the combinatoricsNode branch December 29, 2018 05:49
def update(self):
''' Add/remove sockets as A-Z sockets are connected/disconnected '''

# not a multiple quaternion operation ? => no need to update sockets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which quaternions?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. cut and paste :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants