Get,SetWorldContainer

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.

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....

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.

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.