Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Node Editor API - View Bounds, Node Positions, Node Sizes

    Cinema 4D SDK
    s26 python
    3
    4
    745
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dskeithD
      dskeith
      last edited by

      I'm looking to create some node alignment scripts (Align Vertical, Align Horizontal), and to do that, I believe I'll need the following information:

      Get Methods

      • Current Node Editor + View Context (asked in a separate post)
      • Selected Nodes within the Currently Active Node Editor + Context
      • Node Position (Along with information on where the axis is relative to the node)
      • Node Width/Height (So that I can calculate bounds and add even gaps between nodes)
      • Node Editor Bounds (What's visible min/max)
      • Grid spacing + positioning
      • Nearest Grid Point (for snapping to grid if Snap to Grid is on/active)

      Set Methods

      • Node position (ideally w/ option to snap to the nearest grid point)
      • Node Editor Bounds / Zoom + Pos

      Question

      Which (if any) of the above methods currently exist?

      I'll edit this post if my own research turns up anything useful.

      Related

      • Node Editor API - Active Node Editor Graph? | PluginCafé
      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        As i said in the other thread, the current active node editor can't be retrieve.

        The selected nodes are information that is not stored inside the editor itself but inside the node system. So you can retrieve them using GetSelectedNodes. Be sure to use the one in the GraphModelHelper class and not the old one.

        Grid spacing + positioning

        I'm not sure you can define your own grid spacing.

        All the other questions cannot be answer if you cannot retrieve the active node editor.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • dskeithD
          dskeith
          last edited by

          Not the answer I was hoping for, but helpful nonetheless! Thank you.

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by

            Hello @dskeith,

            without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022.

            Thank you for your understanding,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 0
            • First post
              Last post