The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

General DiscussionFrom the old forum

Broken path to code library

6 replies Last reply

  1. I've run into an odd issue with NodeBox files with dependencies not opening. I have a number of NodeBox projects which use Perlin noise built in Clojure. When I try to open them I receive an error window indicating a problem opening the clj file because the path doesn't exist. The weird thing is the path referenced in the error message is the real path the clj file lives in but repeated 4 times
    (like: path_to_cljFile/path_to_cljFile/path_to_cljFile/path_to_cljFile ) ...so, of course this path doesn't exist, and that explains why it won't open.
    Adding to the confusion, when I open the NodeBox file as xml it shows the path to the clj file is as it should be (not quadrupled like in the error). Also, this problem only occurs with a few NodeBox projects that depend on this code library. Other projects with this dependency will open just fine.
    I'd love to reopen these files and continue to work on the projects (and maybe fix the weird file path thing). Is there any way to disable dependencies when opening a NodeBox project?
    Any suggestions would be greatly appreciated.

    -Tony

    Copy link
  2. Hi Tony,

    This is an all-too-common occurrence whenever people use external code modules. The problem is that when people make their Nodebox projects, they add the code module located in a particular directory, and then later move their project relative to the code module or move the module relative to their directory or enclose one in a new directory or whatever.

    OR they download a Nodebox project with a reference to a particular directory in the file path of the person posting the project which, of course, doesn't exist on their system.

    Sadly, Nodebox does not react well to these little mishaps. It simply refuses to open the Nodebox file at all and belches forth an inscrutable error message. This is why I try to avoid using external code modules whenever I can.

    Fortunately there is a fairly easy fix.

    Just open your NDBX file using a text editor. SEE ATTACHED PHOTO for an example.

    An NDBX file is just an XML file and can be safely edited. All you need to do is remove the line or lines which reference the code module. This will normally be line 7, or several lines starting at line 7 if you have more than one code module in your library, The lines will begin <link href="code module" where code module is the name of your module, e.g. clojure:noise.clj.

    Just select that line or lines and delete it or them (being careful not to delete anything else). Save, relaunch your NDBX file, and it should open fine. You will then need to RE-ADD your module(s) using the normal File/Code Libraries... menu.

    I have no idea how or why the module reference could be chained together four times, but just try removing the whole thing in your text file then re-adding the CLJ module.

    My advice to avoid this kind of thing whenever you want to add a module:

    • STOP
    • SAVE
    • EXIT Nodebox
    • Create a folder just for your project
    • Move your NDBX file into that folder
    • Move a COPY of your module (your .py or .clj file) into the same folder
    • Reopen your Nodebox file
    • Add the module referring to the copy in the same folder

    In this way your module will always live in the same folder as the Nodebox file and the link won't break even if you move that folder or put it into another folder. And if you want to share your project, ZIP THE ENTIRE FOLDER. That way the project and any code modules it needs will always stay together, even on other people's systems.

    BY THE WAY

    I recently added a version of this very same Perlin Noise algorithm into my Cartan Node Library as a node you can just copy and paste. My node uses the same module but wraps it with an extra scale parameter that will save you a little work each time. You will still need to add a COPY of the noise.clj module and wrap everything together in a folder:

    https://forum.nodebox.net/t/5130532072/perlin-noise

    Let me know if this solves your problem!

    John

    Copy link
  3. Hi John,
    I knew you'd have the solution I was looking for! That totally worked. Many thanks!
    I had a hunch there was probably a best practice for bundling all the project files. Thanks for setting me straight on that.

    I'll definitely be checking out your Perlin noise node.

    I've attached a still from the animation of the project I was trying to open. The results were very cool! Very much like sand dollars or sea anemone.

    Many thanks,
    -Tony

    Copy link
  4. Tony,

    Wow! Those stills are way cool! I would love to see the animation. Is it posted anywhere?

    Copy link
  5. Tony

    i like that too
    the pics looks very cool

    gottfried

    Copy link
  6. the animation looks cool too !

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply