Make Editable example [SOLVED]
-
On 10/04/2015 at 03:28, xxxxxxxx wrote:
Hi Andreas,
Thanks for your feedback!
I'll try to do it the better (your) way.But what I'm wondering is, why is the method GetContour() used inside the DoubleCircle SDK example? Doesn't that give threading problems?
Also, I'm changing the active object again after making it editable. The user also doesn't need to select any objects while working with my plugin, just sliders.
Greetings,
Casimir Smets -
On 10/04/2015 at 03:45, xxxxxxxx wrote:
Hi Andreas,
Another quick question: is GetContour() giving the big problem here? Or also the way I'm making my objects? Or is that a matter of personal preference and style?
Thanks for your time and help!
Greetings,
Casimir Smets -
On 10/04/2015 at 03:58, xxxxxxxx wrote:
Hi,
the problem is to call CallCommand() and InsertObject() within GetContour().
GetContour() is called in a thread context, while CallCommand() and InsertObject() are not allowed to be used in a thread context. -
On 10/04/2015 at 06:43, xxxxxxxx wrote:
Hi, me again
We had some discussion about this thread in our team and perhaps I should add some more info.
First of all there's an article about threading in the SDK docs: Important Threading InformationSome more on GetContour(), the same is true for GetVirtualObjects() :
These functions are only thought to generate a spline or an object (these also may have childs) and then return these. Cinema 4D will handle all the integration into the scene. And as these are called in a thread context, you must never ever do any changes directly to the scene in these functions.Finally I completely ignored the "PolygonObject in GetContour" problem. I'm wondering, what you are actually trying to do with this object in GetContour(), as you can't return it and are not allowed to insert it into the scene. The correct place to generate your PolygonObject would rather be GenerateVirtualObjects().
-
On 20/04/2015 at 07:50, xxxxxxxx wrote:
Hi Andreas,
Thanks for your information!
I've tried and tried, but without success.
Could you maybe provide me with a simple example on how to add a nullobject-child to the cube (parent).Also, I'm not allowed to use InsertUnder() inside GetVirtualObjects, right? Or am I wrong?
Thanks for your help and time!
Greetings,
Casimir Smets -
On 20/04/2015 at 08:52, xxxxxxxx wrote:
Hi,
you may use InsertUnder() and alike inside GVO. But you are not allowed to make changes to the active scene (only your objects cache) with these functions during GVO. If you generate a cube in GVO, you are allowed to use InsertUnder() to insert a Null Object as child of the cube. And then later on you can return the cube as result from GVO.
You can simply check it. Just select your generator object and hit the c key. You will see the hierarchy you generated within the Object Manager. -
On 20/04/2015 at 11:20, xxxxxxxx wrote:
Hi Andreas,
Unfortunately, that doesn't work with me. I've tried to add a sphere to the cube with InsertUnder, but nothing to see inside Cinema 4D. Could you please provide me with a simple example on how to add a BaseObject to the cube? It doesn't matter which object.
Thanks for your help and time!
Greetings,Casimir Smets
-
On 20/04/2015 at 12:22, xxxxxxxx wrote:
Hi,
I've finally got it to work, but now my next problem comes up. I have more than a few null objects inside my plugin, but when I make it editable/current state to object, it deletes that null objects, which is definately not what I want. Especially because some are helper objects for their childs.
Is there any way to let null objects stay after making something editable?
Thanks for your help and time!
Greetings,Casimir Smets
-
On 20/04/2015 at 12:26, xxxxxxxx wrote:
Hi,
Allready found my own solution. If you have a null as child, it disappears when making editable/current state to object. If your null is a parent for another object (NOT NULL) it does not go away.
Greetings,
Casimir Smets -
On 21/04/2015 at 12:06, xxxxxxxx wrote:
Hi,
You can mark this as solved!
It works like the way Andreas showed on page 1.Greetings,
Casimir Smets