On 21/12/2016 at 06:51, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
---------
Hi again,
Working on my Seamilar plugin I use the CallUVCommand to perform a relax and realignment of UVs. To do so I get a TempUVHandle by calling the GetActiveUVSet. I read in forum replies that for this to work I need to set the document mode into UVpolygon (or UVpoint).
However, I noticed that even doing so, the returned TempUVHandle is always null IF no BodyPaint 3D Texture View has been opened since Cinema 4D was started.
Open a new Bodypaint 3D Texture View window, and from then on (even after closing the window) the returned TempUVHandle is always successful (in UV mode).
Now, I will be looking for any possible workaround to this, but was wondering if someone already knows a workaround, or maybe I am just doing something wrong?
This is my current code:
// Cinema must be in UV Poly edit mode
BaseDocument* doc = GetActiveDocument();
Int32 currentDocMode = doc->GetMode();
if (Muvpolygons != doc->GetMode())
doc->SetMode(Muvpolygons);
TempUVHandle* handle = GetActiveUVSet(doc, GETACTIVEUVSET_ALL);
if (handle)
<...>
// set the mode back
if (Muvpolygons != currentDocMode)
doc->SetMode(currentDocMode);
So, when I start Cinema 4D with a default layout (or any other one which has no BodyPaint 3D Texture View) the above code will return a null handle. Open a new Texture View, close it, and above code will return a correct handle. Same for R17