snap node

flame's Avatar

flame

25 Feb, 2015 12:16 PM

hæ—

is it possible to modify the snap node or access the grid it uses, to change it ?

  1. Support Staff 1 Posted by Frederik De Ble... on 25 Feb, 2015 07:45 PM

    Frederik De Bleser's Avatar

    Hmm, the snap's node functionality is written in Java. Currently it is impossible to change the implementation easily.

    You can examine the code by looking at the Java source here, and the math implementation here.

  2. Support Staff 2 Posted by Frederik De Ble... on 25 Feb, 2015 08:00 PM

    Frederik De Bleser's Avatar

    Couldn't resist, and re-implemented the snap functionality in Python. That allows you to look at the implementation and change it.

    There's no built-in text editor, but you can use an external editor, then press Command-R in NodeBox to reload the implementation.

  3. Support Staff 3 Posted by Frederik De Ble... on 25 Feb, 2015 08:01 PM

    Frederik De Bleser's Avatar

    Obligatory screenshot:

  4. 4 Posted by flame on 27 Feb, 2015 01:30 AM

    flame's Avatar

    hæ—

    I think I missed part of this but how do you get custom implementations/nodes into the system ?

  5. Support Staff 5 Posted by Frederik De Ble... on 28 Feb, 2015 10:03 AM

    Frederik De Bleser's Avatar

    The example .ndbx file already has this link. 

    The trick is to write a Python file, then in your NodeBox file, link to the code using File > Code Libraries…

    Check out the example I sent you. It should work.

    Grtz,

    F

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

06 Feb, 2025 01:37 AM
04 Feb, 2025 06:32 AM
04 Feb, 2025 05:04 AM
30 Jan, 2025 09:31 AM
30 Jan, 2025 09:08 AM

 

30 Jan, 2025 08:40 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM
21 Jan, 2025 09:41 AM
21 Jan, 2025 09:36 AM