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

    Get,SetWorldContainer

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 316 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 14/10/2012 at 05:02, xxxxxxxx wrote:

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

      ---------
      hi,

      I want to chage value of Preferences

        
      BaseContainer bc = GetWorldContainer();  
      LONG ss = bc.GetLong(WPREF_CAMERAROTATION);  
      GePrint(LongToString(ss));  
        
      bc.SetLong(WPREF_CAMERAROTATION,WPREF_CAMERAROTATION_OBJECT);  
      SetWorldContainer(bc);  
      ss = bc.GetLong(WPREF_CAMERAROTATION);  
      GePrint(LongToString(ss));  
      

      It does not work properly.

      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 14/10/2012 at 15:18, xxxxxxxx wrote:

        I tried to identify all ID in GetWorldContainer()

        but, some containers seem to be missing from GetWorldContainer()

        30006 -> import /export
        1019269 -> cineman
        200000045 ->projection man
        465001700 ->memory
        etc....

        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 18/10/2012 at 09:16, xxxxxxxx wrote:

          Hi,

          WPREF_CAMERAROTATION in the world container only changes the preference for the View (Cameras->Navigation). To update it in the main preferences (Preferences->Navigation->Camera Mode) we have to get the preference plugin for the 'Navigation' category then use the ID of the camera mode, PREF_NAVIGATION_CAMERA.

          Here's how to change the 2 preferences for the camera mode:

          BaseContainer *bc = GetWorldContainerInstance();
          bc->SetLong(WPREF_CAMERAROTATION, WPREF_CAMERAROTATION_OBJECT);
            
          AutoAlloc<AtomArray> plugs;
          if (FilterPluginList(plugs, PLUGINTYPE_PREFS, TRUE))
          {
              BasePlugin *navigation = NULL;
              for (LONG i=0; i<plugs->GetCount(); i++)
              {
                  BasePlugin *plug = (BasePlugin* )plugs->GetIndex(i);
                  if (plug->GetID()==440000091)
                      navigation = plug;
              }
            
              if (navigation)
              {
                  GeData d;
                  d.SetLong(PREF_NAVIGATION_CAMERA_OBJ);
                  navigation->SetParameter(PREF_NAVIGATION_CAMERA, d, DESCFLAGS_SET_0);
              }
          }
          

          440000091 is the ID of the preference plugin for the 'Navigation' category.

          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 19/10/2012 at 05:43, xxxxxxxx wrote:

            thank you very much! Yannick Puech.

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