View Full Version : How to change preferences?
Scott Ayers 08-06-2010, 08:58 PM I haven't tried to change the preferences with a script in a long time. Probably somewhere around the release of version 10.5.
But I swear I used to be able to do it with something like this: var w = GetWorldContainer();
w->SetData(WPREF_DELETEATQUADS, true);//The Document->Delete at quads option
SetWorldContainer(w);
But now it doesn't work anymore.
Did something change?
-ScottA
|
|
Darter
08-07-2010, 12:25 AM
WPREF_DELETEATQUADS is included in the C++ SDK but not the COFFEE SDK. The world container works fine here with those ids which are listed for COFFEE. For example, wc->SetData(WPREF_UNITS_BASIC, UNIT_KM); sets units to km.
synesthetic
08-07-2010, 12:31 AM
I haven't tried to change the preferences with a script in a long time. Probably somewhere around the release of version 10.5.
But I swear I used to be able to do it with something like this: var w = GetWorldContainer();
w->SetData(WPREF_DELETEATQUADS, true);//The Document->Delete at quads option
SetWorldContainer(w);
But now it doesn't work anymore.
Did something change?
-ScottA
Hello,
this actually seems to work when printed to the console. The container values are changed but the checkbox in the preferences is not being updated. I am using this script
var wc= GetWorldContainer(); var tablet= wc->GetData(WPREF_TABLET); wc->SetData(WPREF_TABLET, !tablet); SetWorldContainer(wc);
to toggle graphic tablet mode on/off and this also works fine but won't be updated in the pref dialog.
regards
Scott Ayers
08-07-2010, 01:20 AM
Thanks Darter,
I tried that option and it didn't (appear ) to work either. The settings did not update in the preferences menu.
But then I happened to notice that the units in the coordinate manger did change.
So I looked up the supported id's in the 9.5 SDK and tested out some more of them and I'm getting the same behavior. Where the WorldContainer() function doesn't update the preferences settings. So any changes I make with a script get lost when C4D is shut down.:sad:
Is this one of those coffee limitations?
-ScottA
Darter
08-07-2010, 04:15 AM
It's working fine here with all ids tested. Make sure that the Preferences dialog is closed when you change a setting. Otherwise the setting will change without updating in the dialog and will revert when the dialog is closed.
Scott Ayers
08-07-2010, 03:08 PM
Thanks again Darter.
That works....Although it's a bit strange and not what I had expected.
Since the the tool dialogs update when a script is run. I expected the same behavior from the preferences. But I guess the preferences are hooked into the program differently.:shrug:
Welcome Boris,
It's nice to see another new person here.
-ScottA
CGTalk Moderation
08-07-2010, 03:08 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.