On 05/02/2014 at 07:59, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13,14,15
Platform: Windows ;
Language(s) : C++ ;
---------
Hi, if I insert a primitive cube in a document, it defaults to a certain size.
If I then scale up the document by a factor of 10, then insert a new cube, this new cube is 10 times smaller.
What I need is to detect the scale of this C4D "world", because I want so scale up a newly created object, so that it visually has the same size, regardless of the C4D "world scale".
This code is totally useless:
BaseContainer* bc = doc->GetSettingsInstance(DOCUMENTSETTINGS_DOCUMENT);
UnitScaleData* usd = (UnitScaleData* )bc->GetCustomDataType(DOCUMENT_DOCUNIT, CUSTOMDATATYPE_UNITSCALE);
Real docScale = 0;
DOCUMENT_UNIT docunit = 0;
usd->GetUnitScale(docScale, docunit);
It is useless because docScale always == 1. I scale up the document ten times. Still returns 1.
How can I get hold of the scale of the C4D world for the current document? So that I can use this value to scale the objects I programmatically insert into C4D?