{"id":28479269,"url":"https://github.com/walles/nodecode","last_synced_at":"2025-08-06T15:13:27.779Z","repository":{"id":290497348,"uuid":"974636865","full_name":"walles/nodecode","owner":"walles","description":"Copy / paste Blender node setups as editable text","archived":false,"fork":false,"pushed_at":"2025-05-30T19:52:41.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T18:08:42.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-29T04:46:18.000Z","updated_at":"2025-05-30T19:52:46.000Z","dependencies_parsed_at":"2025-04-29T06:24:56.137Z","dependency_job_id":"cc9261e0-2eaf-45e2-93f5-c0e3eda38036","html_url":"https://github.com/walles/nodecode","commit_stats":null,"previous_names":["walles/nodecode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/walles/nodecode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fnodecode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fnodecode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fnodecode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fnodecode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walles","download_url":"https://codeload.github.com/walles/nodecode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Fnodecode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263350414,"owners_count":23453279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T18:08:43.596Z","updated_at":"2025-07-03T15:32:11.849Z","avatar_url":"https://github.com/walles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Code\n\nCopy / paste Blender node setups as text.\n\nImagine for example that you're looking at a tutorial to make a procedural wood\nshader.\n\nWithout Node Code, to get the completed material you would have to either:\n\n1. Draw the node setup by hand in Blender, based on the tutorial\n2. If the tutorial comes with a `.blend` file, download that and append the\n   material to your own file.\n\nWith Node Code, the tutorial can just include a text with the node setup.\n\nYou copy the text, paste it in Blender, and voilà! You have the node setup ready to\ngo.\n\nThe text format is a subset of Python, so you can open Node Code files in a text\neditor, and edit them there.\n\n# Hacking\n\nRun `tox` frequently to verify your changes.\n\n## Layout\n\n- `extract-blender-types.py`: Extracts Python type stubs from Blender into [the\n  `nodecode/` directory](nodecode/). Documented in a comment at the top of the\n  file.\n- `add_on`: Contains the Blender Node Code add-on.\n\n# TODO\n\n- Test roundtripping a node setup with a Color Ramp node\n  - OK: Make export work\n  - Make import work\n- Verify roundtripping a setup with Noise -\u003e Color Ramp -\u003e Principled BSDF\n- Improve Python formatting of multiple Color Ramp stops\n- Test node layout with Principled vs Diffuse and check the layout seems to get\n  the node heights about right\n- Regenerate the type stubs and check that the Mix Shader gets inputs named\n  Shader_1 and Shader_2 and that the color ramp gets a ColorRamp input\n- Make extract-blender-types.py extract Color Ramp nodes\n- Make sure we handle node groups\n  - Read them from Blender\n  - Write them to Python\n  - Read them from Python\n  - Write them to Blender\n- Make sure we handle reroute nodes\n- Add an instructions comment to the generated code, and a link to the GitHub\n  repository\n- Verify no warnings are printed to the console on imports or exports\n- Try export or import when the node area is the only open area\n- When importing, make sure any problems are obviously reported to the user.\n  Through in-code highlights or popups. Remove any assert statements from the\n  import code.\n- Document a versioning scheme based on the Blender version\n- Add an example material to this README\n- Don't name the exported editor \"Node_Code_Hello_World.py\", but rather\n  something based on the material name\n- Try removing all materials and exporting\n- Try removing all objects and importing\n- Publish Python type stubs to PyPI\n- Publish the add-on to Blender Extensions\n- Decorate some random tutorial(s) with Node Code\n- Ensure the generated code has type hints where applicable\n- Test that a generated nodecode file passes mypy without any complaints\n- Adding multiple noise nodes in Blender names them Noise, Noise.001, Noise.002,\n  etc. Convert this naming scheme to either just Noise (if there is only one),\n  or to Noise_1, Noise_2, etc if there are multiple. This will look nicer in the\n  Python code.\n- Enable the add-on to show Node Code for a Geometry node setup\n- Enable the add-on to show Node Code for a Compositing node setup\n- Consider whether we could / should exclude default values in the generated\n  code? This would make Principled BSDF nodes much easier to read.\n- Resolve all FIXMEs\n- Make sure the extracted-from-Blender Python stubs have no `Any` types\n\n## Done\n\n- Extract Python type stubs from Blender\n- Make sure the Python stubs come with type hints\n- Make a Blender add-on that can show Node Code for a Shaders node setup\n  - This should be added to the View menu of the respective node editors. The\n    menu entry should say \"Node Code...\".\n  - Make sure the generated tree contains the Target dropdown for the Material\n    Output node.\n  - Make it generate Python code\n  - Quote string values\n  - Output tuple values as tuples\n  - Make sure the generated code contains no forward references\n  - Make main return the right value\n- Implement converting Node Code to an internal node system object\n- Right click the node area for Node Code access\n- Enable the add-on to generate a node setup from Node Code source\n- Try importing into a freshly started Blender instance\n- Fix warnings when importing Principled BSDF nodes\n- Test roundtripping the default material node setup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalles%2Fnodecode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalles%2Fnodecode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalles%2Fnodecode/lists"}