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

    How to get basic units setting?

    SDK Help
    0
    7
    846
    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
      Helper
      last edited by

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

      On 06/03/2003 at 11:30, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   7.303 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello,
      I have searched the archives and docs and can't find a function to retrieve the value of the Basic Units pref in R7's General Settings.
      Thanks,
      Jane

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

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

        On 14/03/2003 at 13:52, xxxxxxxx wrote:

        Check out GetWorldContainer().

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

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

          On 15/03/2003 at 16:14, xxxxxxxx wrote:

          Sorry, what is the id I am looking for in the BaseContainer? There is no description of what is in the world container.
          I know some other applications always return everything in meters, regardless of what the user has set the units at. Does C4D do something similar? What I'd like to do is scale a material according to the type of units.
          Thanks,
          Jane

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

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

            On 15/03/2003 at 23:59, xxxxxxxx wrote:

            Sorry, I could have been more clear. Look at the LONG WPREF_UNIT_BASIC value. It corresponds directly to the 0-based index of the units in the general preference dialog.

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

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

              On 04/12/2008 at 13:05, xxxxxxxx wrote:

              fyi :

              This is
              WPREF_UNITS_BASIC

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

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

                On 04/12/2008 at 13:36, xxxxxxxx wrote:

                BaseContainer wldContainer = GetWorldContainer();
                            int unit = int( wldContainer.GetData(WPREF_UNITS_BASIC).GetLong() );

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

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

                  On 18/12/2008 at 20:09, xxxxxxxx wrote:

                  LONG units;
                  BaseContainer* worldContainer = GetWorldContainerInstance();
                  if (worldContainer)
                  {
                  units = worldContainer->GetLong(WPREF_UNITS_BASIC);
                  }

                  Why the obfuscation? Conversion from LONG to int takes time as well as GetData().GetLong(). Of course, if you want to 'set' this setting, you should use GetWorldContainer() and SetWorldContainer() (refer to SDK documentation).

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