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:
Cinema 4D Version: 7.303
Platform: Windows ;
Language(s) : C++ ;
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.
On 14/03/2003 at 13:52, xxxxxxxx wrote:
Check out GetWorldContainer().
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.
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.
On 04/12/2008 at 13:05, xxxxxxxx wrote:
On 04/12/2008 at 13:36, xxxxxxxx wrote:
BaseContainer wldContainer = GetWorldContainer();
int unit = int( wldContainer.GetData(WPREF_UNITS_BASIC).GetLong() );
On 18/12/2008 at 20:09, xxxxxxxx wrote:
BaseContainer* worldContainer = GetWorldContainerInstance();
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).