Skip to content

Conversation

@BrendanParmer
Copy link
Owner

@BrendanParmer BrendanParmer commented Oct 5, 2025

This PR begins the revamp of NodeToPython's UI, in preparation for supporting more node tree types and exporting multiple node groups at once.

Changes

Features

  • Node groups are now added to a UI list according to their type. This replaces selecting node groups at export-time, and will enable exporting multiple node groups in the near future
  • Exports are now done with a single button, whose label/icon changes dynamically with the export mode, number of node groups, etc.
  • New fields for exporting shader node groups, world nodes, light nodes, and line style nodes.
  • The options panel has been cleaned up, grouping similar options underneath sub-panels
  • Some option names and tooltips have been reworked to be more descriptive

Refactor

  • Class and property registration has been revamped.
    • Each module now defines an optional variable classes: list[type] to be registered and unregistered in the base __init__.py
    • Each module now defines optional functions register_props() and unregister_props() for registering global variables to the scene.
  • Classes and scene properties have been renamed to align closer to Blender's naming conventions

Other

  • Removes vestigial NodeToPythonMenu class, which wasn't actually used
  • Fix up some warnings, incorrect type hints, unused imports

Issues

Completed

In Progress

TODO

  • Exporting multiple node groups is currently unsupported. There's some design questions I still need to work out before the release. If it can't be done in time for 4.0 the UI should be updated to make it a bit clearer that only exporting one group is supported, I'm hoping not to need to do this though.

@BrendanParmer BrendanParmer added this to the v4.0 milestone Oct 5, 2025
@BrendanParmer BrendanParmer self-assigned this Oct 5, 2025
@BrendanParmer BrendanParmer added enhancement New feature or request refactor Clean up or reorganize the code labels Oct 5, 2025
update=update_node_tree
)

class NTP_OT_AddCompositorNodeGroupSlot(bpy.types.Operator):
Copy link
Owner Author

Choose a reason for hiding this comment

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

I imagine a lot of these classes could probably inherit from a common base class, might not have time for this release though


from enum import Enum, auto

class NodeGroupType(Enum):
Copy link
Owner Author

Choose a reason for hiding this comment

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

NodeGroupType and NodeGroupGatherer probably aren't appropriately placed

@BrendanParmer BrendanParmer merged commit 42e80d5 into v4.0 Oct 5, 2025
@BrendanParmer BrendanParmer deleted the UIImprovements branch October 5, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor Clean up or reorganize the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants