Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/02/2011 at 14:11, xxxxxxxx wrote:
User Information: Cinema 4D Version: 12 Platform: Windows ; Language(s) : C++ ;
--------- I'm trying to change the CenterAxisTool settings through a menu plugin. But It's not working. Here's my code:
BaseContainer bc; BaseObject *op = doc->GetActiveObject(); ModelingCommandData mcd; mcd.bc = op->GetDataInstance(); mcd.doc = doc; mcd.op = op; mcd.flags = MODELINGCOMMANDFLAGS_CREATEUNDO; bc.SetBool(MDATA_CENTER_CENTER,TRUE); if (!SendModelingCommand(ID_MODELING_CENTER_TOOL, mcd)) return FALSE; EventAdd();//Update all the changes
And here's the MDATA options listed in the toolcenter.h file I'm using so you guys don't have to look them up. There's are a lot more options in the tool that aren't listed in this .h file. So I'm assuming that they aren't available through the API?
enum { MDATA_CENTER_XAXIS = 1000, MDATA_CENTER_YAXIS = 1001, MDATA_CENTER_ZAXIS = 1002, MDATA_CENTER_NONE = 0, MDATA_CENTER_NEG = 1, MDATA_CENTER_POS = 2, MDATA_CENTER_CENTER = 3, MDATA_CENTER_ };
Anyone know what I'm doing wrong?
-ScottA
On 11/02/2011 at 04:47, xxxxxxxx wrote:
You set data in bc, but don't use it for the command.
mcd.bc = bc; // not op->GetDataInstance()
On 11/02/2011 at 08:15, xxxxxxxx wrote:
Thank you. That got me closer. But it still won't do anything.
Here's my code:
BaseContainer bc; BaseObject *op = doc->GetActiveObject(); ModelingCommandData mcd; mcd.bc = &bc; mcd.doc = doc; mcd.op = op; mcd.flags = MODELINGCOMMANDFLAGS_CREATEUNDO; bc.SetBool(MDATA_CENTER_CENTER,TRUE); if (!SendModelingCommand(ID_MODELING_CENTER_TOOL, mcd)) return FALSE; EventAdd();
I double checked myself on this code by using an MCOMMAND_OPTIMIZE version of it. And it works. So I think I've got the code right (I hope). But I still can't make the Axis Center tool respond.
On 11/02/2011 at 09:24, xxxxxxxx wrote:
You might need to set mcd.mode . mcd.mode = MODELINGCOMMANDMODE_ALL;
On 11/02/2011 at 09:50, xxxxxxxx wrote:
I tried that too. But it didn't seem to help. In fact. I've had no luck at all using the MODELINGCOMMANDMODE_ALL option in other cases too. I have been meaning to go back and see why that option was never working for me. I've tried two different ways to use it: 1.) mcd.mode = MODELINGCOMMANDMODE_ALL; 2.) bc.SetBool(MODELINGCOMMANDMODE_ALL,TRUE);
Neither one worked for me.
On 11/02/2011 at 12:50, xxxxxxxx wrote:
Doh! Sorry guys.
I just found a "Center" tool under the functions menu. And based on the MDATA entries in the toolcenter.h file. It looks like this is what they are for. I didn't even know it was there. And it does something completely different from the Axis Center tool. So it's no wonder that my code wasn't working.
I can't seem to find anything in the SDK's referring to the Axis Center tool found under the Structure menu. So At this point, I don't know if it's even supported.
On 14/02/2011 at 02:22, xxxxxxxx wrote:
Sorry, calling the Axis Center functions is not possible through the C++ API.
cheers, Matthias
On 14/02/2011 at 07:30, xxxxxxxx wrote:
Bummer. It would be very nice to have access to this tool.
Thank you for confirming that it's not available.
On 03/04/2011 at 08:06, xxxxxxxx wrote:
Is that also true for ID_MODELING_OUTLINE_SELECTION_TOOL? (If yes, why is it documented in the SDK?)
I'm trying and trying and always get FALSE. If I send another command like ID_MODELING_NORMALMOVE_TOOL it works, so it can't be a problem of calling from a forbidden context.
On 04/04/2011 at 02:40, xxxxxxxx wrote:
Outline selection is not supported through SendModelingCommand. I will remove it from the docs. Thanks for pointing it out.