indiepython / nodezator Goto Github PK
View Code? Open in Web Editor NEWA generalist Python node editor
Home Page: https://nodezator.com
License: The Unlicense
A generalist Python node editor
Home Page: https://nodezator.com
License: The Unlicense
During the development of new nodes it would be convenient, if I could reload all local nodes at once.
All nodes in the current graph would need to be redrawn, and invalid connections deleted.
Auto reloading when a node is changed, would be even better.
Originally posted by gregismotion February 2, 2024
If I've enough errors the dialog can grow so large the OK button goes off-screen,
This could be worked around by the Enter key working for OK, but still isn't the best user experience. At this moment I've to restart the app.
Relevant excerpt from my reply to the original post:
I'll create an issue for it and prioritize solving this problem. I expect the patch solving the problem to be released within a week or two. The problem is fairly easy to solve because all the services needed to do so are already implemented, I just have to put what is needed together. I'll probably make it so whenever the contents of dialogs are big enough to overflow the screen they are turned into a scrollable panel.
Depending on my available time I may also use the opportunity to finish my work related to making the dialogs dismissable using the keyboard, as @gregismotion also suggested and has also been suggested in the past by other users.
Peace.
Hello,
I got this error immediately after trying clicking on "new file" or "open file" (on the splash screen or menu bar).
Version 1.12 release candidate.
python3 -m nodezator
Traceback (most recent call last):
File "[...]/nodezator/fileman/dirpanel/main.py", line 351, in update_path_objs_appearance
try: index = self.selectable_paths.index(
ValueError: None is not in list
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "[...]/nodezator/__main__.py", line 113, in <module>
main(args.filepath)
File "[...]/nodezator/__main__.py", line 72, in main
run_app(filepath)
File "[...]/nodezator/mainloop.py", line 208, in run_app
raise err
File "[...]/nodezator/mainloop.py", line 97, in run_app
loop_holder.handle_input()
File "[...]/nodezator/splashscreen/op.py", line 134, in handle_input
self.on_mouse_release(event)
File "[...]/nodezator/splashscreen/op.py", line 175, in on_mouse_action
else: method(event)
File "[...]/nodezator/ourstdlibs/behaviour.py", line 559, in execute
return func()
File "[...]/nodezator/winman/fileop.py", line 78, in new
paths = create_path(caption=NEW_FILE_CAPTION)
File "[...]/nodezator/fileman/op.py", line 117, in browse_paths
self.dir_panel.load_current_dir_contents()
File "[...]/nodezator/fileman/dirpanel/loadop.py", line 93, in load_current_dir_contents
self.update_path_objs_appearance()
File "[...]/nodezator/fileman/dirpanel/main.py", line 367, in update_path_objs_appearance
if path_obj.text == PATH_OBJ_PARENT_TEXT:
AttributeError: 'PathObject' object has no attribute 'text'
There are a few problems I have with the documentation.
This picture is nice, but an actual practical example directory would be nice:
For example, using this: https://ascii-tree-generator.com/, you could make an example tree of what the directory should look like.
How do I see the node made in the first tutorial?
We learn how to make a node like so:
, but there aren't instructions on how to load this node in and see it in the nodezator UI.
I hope you don't misunderstand, I believe this documentation I am looking for exists, but I think most users would prefer a quick start where they can write a node and see it in their window.
I placed two integer nodes before and after an “abs” node and connected them one by one. The last integer node still shows “0” after changing the value in the first node and clicking on “Execute graph”.
Hello, I was surprised that no default nodes were included in the default install:
The documentation only says this about how to install the node packages, but it isn't clear enough exactly what I should do to install them, and this may confuse other users:
Thanks, I love the idea behind this project!
The last update seems to have broken the Python exporting feature for some cases (likely when a builtin node is involved). I'm sorry for the inconvenience. It is likely a minor typo or some value I forgot to adjust. My desktop should be back from maintenance by tomorrow. I'll then be able to restore the feature right away.
Environment:
Windows 7
Python 3.9 (backport)
Steps to reproduce:
The application crashes to the desktop.
Error message:
Traceback (most recent call last):
File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "d:\nodezator\nodezator\__main__.py", line 95, in <module>
parse_args_and_execute_main()
File "d:\nodezator\nodezator\__main__.py", line 89, in parse_args_and_execute_
main
main(filepath)
File "d:\nodezator\nodezator\__main__.py", line 56, in main
run_app(filepath)
File "d:\nodezator\nodezator\mainloop.py", line 209, in run_app
raise err
File "d:\nodezator\nodezator\mainloop.py", line 98, in run_app
loop_holder.handle_input()
File "d:\nodezator\nodezator\ourstdlibs\collections\general.py", line 20, in _
_call__
item()
File "d:\nodezator\nodezator\winman\states\loadedfile.py", line 106, in loaded
_file_event_handling
self.loaded_file_on_mouse_release(event)
File "d:\nodezator\nodezator\winman\states\loadedfile.py", line 506, in loaded
_file_on_mouse_release
obj.on_mouse_release(event)
File "d:\nodezator\nodezator\graphman\callablenode\vizop\main.py", line 87, in
on_mouse_action
method(event)
File "d:\nodezator\nodezator\widget\pathpreview\base.py", line 362, in on_mous
e_release
self.preview_paths()
File "d:\nodezator\nodezator\widget\pathpreview\text.py", line 140, in preview
_paths
text = path.read_text(encoding="utf-8")
File "C:\Python39\lib\pathlib.py", line 1266, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
File "C:\Python39\lib\pathlib.py", line 1252, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "C:\Python39\lib\pathlib.py", line 1120, in _opener
return self._accessor.open(self, flags, mode)
PermissionError: [Errno 13] Permission denied: '.'
Some form of error handling would be nice. Ideally an application should never crash to the desktop.
I accidently connected one node to other node that I dont intend to.
But I am unable to delete the connection.
This is probably Python's weird behaviour, not sure how it could be handled here.
https://github.com/KennedyRichard/nodezator/blob/db450b84f439f3b458b4c0c80dcfed47432bfe03/nodezator/ourstdlibs/pyl.py#L18 is not catching SyntaxError on malformed file. It would be helpful to at least display an error and full pathname of faulty document.
sidenote: on retry after a crash the full pathname is not displayed either.
The widgets in eval
nodes doesn't let you type any text you want. Instead, only text representing Python literals is allowed. To see this for yourself:
eval
node; for instance, right-click the canvas, then in the popup menu go to "Builtin picks" > "C-E" > eval(string_source,...)
;1+1
(you won't be able to);If you type a Python literal though, like '1+1'
or 2
it works.
This bug was first discovered by Mr. Alexander @OlegAlexander here and further examined and explained by me here.
The bug is actually not in the code, but a wrong configuration passed to the widget.
I'm sorry for the inconvenience this may have caused to some of you. I'll fix it asap.
Peace.
Have tried the nodezator app and I like it very much. I have a big screen but the main widows' size is small and fixed. It would be great if the window can be resized.
I have tried to update the constants to match my screen size with no luck(My system is Windows 10, screen size is 1920 x 1080, also tried to set the text scale to 100%, 120% or 150% does not work either).
pygameconstants.py
SCREEN_WIDTH, SCREEN_HEIGHT = 1280, 720
FLAG, DEPTH = 0, 32
Launching the app results in 3,864 calls to Font.size(" "), 24 of which are unique. According to snakeviz (usage) this takes 0.99 seconds on my computer.
I'd expect Font.size(" ") to be called 24 times, as there is a caching system in place.
Count redundant executions
print(f"A-{desired_height}: {font.name}")
print(f"B-{size}: {font.name}")
pbpaste | wc -l
)pbpaste | sort -u | wc -l
)$ pip install snakeviz
$ python3 -m cProfile -o program.prof -m nodezator
$ snakeviz program.prof
Originally posted by gregismotion February 3, 2024
Minor hindrance for small node-packs, major issue for big and evolving projects.
Given a graph:
(attached)
clicking on a red x to remove the value of the data source results in an immediate closing of the app.
seen on python3.11 + pygame-dev
File "main.py", line 44, in <module>
__main__.main(args.filepath)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/git/nodezator/nodezator/__main__.py", line 72, in main
run_app(filepath)
^^^^^^^^^^^^^^^^^
File "/data/git/nodezator/nodezator/mainloop.py", line 203, in run_app
raise err
^^^^^^^^^
File "/data/git/nodezator/nodezator/mainloop.py", line 92, in run_app
loop_holder.handle_input()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/git/nodezator/nodezator/ourstdlibs/collections/general.py", line 18, in __call__
for item in self: item()
^^^^^^
File "/data/git/nodezator/nodezator/winman/states/boxselection.py", line 43, in box_selection_event_handling
APP_REFS.ea.confirm_box_selection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/git/nodezator/nodezator/editing/selection.py", line 274, in confirm_box_selection
self.box_select_extend_colliding()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/git/nodezator/nodezator/editing/selection.py", line 331, in box_select_extend_colliding
self.active_obj = sample(colliding_objs, 1).pop()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/git/python-wasm-plus/devices/x86_64/usr/lib/python3.11/random.py", line 436, in sample
raise TypeError("Population must be a sequence. "
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Population must be a sequence. For dicts or sets, use sorted(d).
When opening an exported as python graph with IDLE on Windows, I get:
Mixed newlines detected.
The file will be changed on save.
I see in graphman/pythonrepr that you use os.linesep almost everywhere, but you missed one normal newline: https://github.com/KennedyRichard/nodezator/blob/master/nodezator/graphman/pythonrepr.py#L157
However, I believe I believe it would be more correct to change out all your use of os.linesep for normal newlines.
See the os.linesep documentation:
Do not use os.linesep as a line terminator when writing files opened in text mode (the default); use a single '\n' instead, on all platforms.
I also found this handy stackoverflow post that explained it to me: https://stackoverflow.com/questions/38074811/what-is-os-linesep-for.
I suggest moving from upstream pygame to the recently branched pygame-ce. It's a good investment to make in the long run as all the contributors moved from the former to the latter. You can view the new site at https://pyga.me/
Node:
from lazysocials.platforms import Twitter
from lazysocials.platforms.twitter import TwitterAuth
from lazycommon.content.types import Content
from typing import Type
main_callable = Twitter
def _Twitter(auth: TwitterAuth, max_images: {"widget_name": "int_float_entry", "widget_kwargs": {"min_value": 0, "max_value": 4}, "type": int} = 4, *types: Type[Content]) -> [{"name": "twitter", "type": Twitter}]:
pass
signature_callable = _Twitter
Twitter:
class Twitter(Platform):
def __init__(self, auth: TwitterAuth, max_images: int = 4, *types: Type[types.Content]):
self._twitter_auth = auth
self.max_images = max_images
print(f"twitter: {types}")
super().__init__(types)
# ...
# A chain of inheritance is formed with Platform
And the root init gets called, thus the signature is obv. incorrect and it fails.
(The first init only needs a list, while we get an int for in the Twitter
class)
For now I can make a function that calls the init correctly, but Callable mode will not work that way obv. like so:
def _Twitter(auth: TwitterAuth, max_images: {"widget_name": "int_float_entry", "widget_kwargs": {"min_value": 0, "max_value": 4}, "type": int} = 4, *types: Type[Content]) -> [{"name": "twitter", "type": Twitter}]:
return Twitter(auth, max_images, *types)
main_callable = _Twitter
A number of folks have posted in the Reddit thread:
https://old.reddit.com/r/Python/comments/vf6h1z/nodezator_new_python_node_editor_released_to/
would you want to enable discussions here on GitHub?
https://docs.github.com/en/discussions/quickstart
It would make sharing images and files easier.
Pretty much any attempt to interact w/ the file objects crashes.
on Windows 10:
app vanishes
Are there crash logs or anything which will help?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.