Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Create output ports for python tag

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 365 Views
    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.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 28/11/2011 at 05:21, xxxxxxxx wrote:

      Hi everyone,

      Can you please tell me if there's a way to automatically add/remove ports on Python tag being based on Input number?

      something like that:

      def main() :
          for i in range(Input1) : # < int, number of Outputs
              nnn = "Output" + str(i+1)
              globals()[nnn] = float()
              #code for adding n-number of Output ports
      

      I want to have something similar but without manually adding the ports:

      Many thanks!

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 28/11/2011 at 12:45, xxxxxxxx wrote:

        Hi sergey,

        changing the document structure from the execution methods of a tag/node or object is bad and will lead to crashs. What exactly are you trying to achieve?

        Cheers, Sebastian

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 28/11/2011 at 23:17, xxxxxxxx wrote:

          Hi Sebastian!

          I was trying to make python tag that would calculate set of values for Range Mapper based on amount of Input and will create corresponding number of output ports.

          For example with Input = 2 the tag shoud've return four Outputs:
          (0, 100/Input - (20/Input), 100/Input + (20/Input), 100) which would give the Range Mapper ranges 0..60 and 40..100 for 2 user datas.
          With Input = 3 the tag shoud've return six Outputs:
          (0, 100/Input - (20/Input), 100/Input + (20/Input), 100/Input*2 - (20/Input), 100/Input*2 + (20/Input), 100) which would give the Range Mapper ranges 0..40 26,6..73.2 60..100

          But as I understand, I can get the values and variables I want inside Python tag but ports should be added manually

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