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

    Script request: Automatic scale UVW map to a specific size

    General Talk
    3
    4
    741
    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.
    • P
      Peter Hofmann
      last edited by

      Hi There,

      I do create unwrapped UV maps for lots of objects that all need a UV map scaled in a special way, so all maps could use one texture (color only, with bumpiness). In this case a 5x5cm texture in size.

      Is it possible to write a script that scales an relaxed and packed equalized island size UV map to a specific size, for example 5x5cm? Right now I check the object size and scale it manually.

      Thank you very much for your help

      Best regards,
      Peter

      1.jpg

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

        Hello @peter-hofmann,

        welcome to the Plugin Café and thank you for reaching out to us. Please read the Forum Guidelines for future questions. This is a forum about the development of Cinema 4D plugins and scripts run by Maxon to provide support for developers. Requests for scripts are not within the scope of the forum, and when they must be posted, they should be posted under General Talk.

        I therefore have treated your question as a programming question. Please also note that we, Maxon, cannot provide full solutions.

        The primary misconception of yours is that objects and vertices (or UV vertices in this case) would have an implicit unit as for example centimeters or meters. But they do not, all units you see in the interface are only an "illusion" for the end user. The data itself is unitless, e.g., an object has the width of five units, and not a width of five centimeters (although the interface might display it in that form). The same applies to UV islands, there are no UV-islands with the size 5*5cm, there are only UV islands where the UV-vertices all lie in the interval [0, 5] on both axis, i.e., a "5*5 units" UV-island.

        You can manipulate UV vertices directly by reading and writing from a c4d.UvwTag or use c4d.modules.bodypaint.CallUVCommand to invoke one of the existing UV commands. We have an example for CallUVCommand on GitHub.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • P
          Peter Hofmann
          last edited by

          Hi Ferdinand, thank you very much and thanks for placing it at correct location. Hopefully someone is able to help me out a bit since I am not a programmer just got an internal request, how to do it and need to find out how to solve it. You know same as always... 🙂

          1 Reply Last reply Reply Quote 0
          • a_blockA
            a_block
            last edited by

            Well, helping out is generally my business. Although I have to admit, I have some problems understanding the actual goal.
            If you like, contact me via job AT andreasblock DOT de

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