Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

DescriptionToolData-InitDefaultSettings

 Post Reply Post Reply
Author
Message
petersmoney View Drop Down
Member
Member
Avatar

Joined: 2011 Feb 21
Online Status: Offline
Posts: 92
Post Options Post Options   Quote petersmoney Quote  Post ReplyReply Direct Link To This Post Topic: DescriptionToolData-InitDefaultSettings
    Posted: 2013 Nov 20 at 9:50pm

User Information:

Cinema 4D Version:   15 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s):     C++  ;   

---------

In DescriptionToolData, when gets DescriptionToolData::InitDefaultSettings actually called?

The SDK info seems to imply that I use it to set my gadgets to their defaults. But at least in my code it never seems to go there.

At the moment I am using DescriptionToolData::InitTool to set the defaults but since that happens every time my tool gets called it's not ideal.

Am I missing something?

Thanks

Peter

Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1084
Post Options Post Options   Quote Yannick Puech Quote  Post ReplyReply Direct Link To This Post Posted: 2013 Nov 20 at 11:45pm
Hi Peter,

DescriptionToolData::InitDefaultSettings() is called once, at its first execution, to set the default value of its settings.

Are you sure you use the right prototype?
It's void DescriptionToolData::InitDefaultSettings(BaseDocument* doc, BaseContainer& data)

See its simple implementation in the R15 SDK example SculptDrawPolyTool (sculpting\drawpoly.cpp). I put a breakpoint in it and it's called as expected by CINEMA.




Edited by Yannick Puech - 2013 Nov 20 at 11:51pm
MAXON
Developer Support
Back to Top
petersmoney View Drop Down
Member
Member
Avatar

Joined: 2011 Feb 21
Online Status: Offline
Posts: 92
Post Options Post Options   Quote petersmoney Quote  Post ReplyReply Direct Link To This Post Posted: 2013 Nov 22 at 12:31pm
Thanks for the tip.

I didn't realize I also need this line in my function:

DescriptionToolData::InitDefaultSettings(doc, data);

Now it works. Although I don't exactly know why....


Peter


Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.