virtual Bool GetDEnabling

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/08/2009 at 13:51, xxxxxxxx wrote:

User Information:
Cinema 4D Version:    
Platform:      
Language(s) :

---------
I am looking at the SDK and looking at the virtual Bool GetDEnabling () function.

I am confused as to how the syntax would look for this function.

This is what the SDK says.

> `

  
\>  virtual Bool GetDEnabling(BaseDocument* doc, BaseContainer& data, const DescID& id, GeData& t_data, LONG flags, const BaseContainer* itemdesc)  
\>  

`

I am not sure what some of those arguments are.
could someone explain them a little more in depth.

Thanks,

~Shawn

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/08/2009 at 14:45, xxxxxxxx wrote:

It's rather simple. You set the state based on whatever. In the case below, it is based on a description state (a checkbox).

> // NodeData.GetDEnabling \> //\*---------------------------------------------------------------------------\* \> Bool GreeblerObj::GetDEnabling(GeListNode\* node, const DescID& id, GeData& t_data, LONG flags, const BaseContainer\* itemdesc) \> //\*---------------------------------------------------------------------------\* \> { \>      if (!node)                    return FALSE; \>      BaseContainer\*     bc =     ((BaseObject\* )node)->GetDataInstance(); \>      if (!bc)                    return TRUE; \> \>      LONG               did =     id[0].id; \> \>      // Dynamic Description Ranges \>      // - Custom Greebles \>      if ((did >= GREEBLER_GREEC_BITMAP) && (did < GREEBLER_GREEC_FREQ)) \>           return bc->GetBool(GREEBLER_GREEC_GENERATE); \> \>      // Static Descriptions \>      // Enable/Disable editability \>      switch (did) \>      { \>           // General \>           // Base \>           case GREEBLER_BASE_SELECTIONS: \>           case GREEBLER_BASE_SPARSITY: \>           case GREEBLER_BASE_HEIGHT_MIN: \>           case GREEBLER_BASE_HEIGHT_MAX: \>           case GREEBLER_BASE_BEVEL_MIN: \>           case GREEBLER_BASE_BEVEL_MAX: \>           case GREEBLER_BASE_BCAP: \>                // The aboves' state is dependent upon this description's state \>                return bc->GetBool(GREEBLER_BASE_GENERATE); \> \>           default: \>                break; \>      } \>      return SUPER::GetDEnabling(node, id, t_data, flags, itemdesc); \> }

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/08/2009 at 17:54, xxxxxxxx wrote:

Thannks kuroyume0161,

It's always much more simple to understand in context.   Thanks for taking the time to help.

~Shawn

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/08/2009 at 19:45, xxxxxxxx wrote:

If I was to compile your example and write all of the necessart .res and .h files, would I need to remove node, id, t_data, flags, itemdesc, efrom the arguments when i declare the initial function?

~Shawn

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/08/2009 at 21:39, xxxxxxxx wrote:

As you are defining an override function for a virtual function it must retain the exact arguments and return type to function properly. Whether you need the other arguments doesn't matter.

The declaration and definition should match. In the class header:

Bool GetDEnabling(GeListNode* node, const DescID& id, GeData& t_data, LONG flags, const BaseContainer* itemdesc);

and as shown (generally) in the previous post for the class cpp file.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/08/2009 at 08:02, xxxxxxxx wrote:

okay when I try to build the project I get this.

> `

  
\>  1>------ Build started: Project: truesymmetry, Configuration: Debug Win32 ------  
\>  1>Compiling...  
\>  1>truesymmetry.cpp  
\>  1>c:\users	he fosters\desktop\cinema4dr11010\plugins	ruesymmetry\source	ag	ruesymmetry.cpp(189) : error C2065: 'node' : undeclared identifier  
\>  1>c:\users	he fosters\desktop\cinema4dr11010\plugins	ruesymmetry\source	ag	ruesymmetry.cpp(189) : error C2065: 'id' : undeclared identifier  
\>  1>c:\users	he fosters\desktop\cinema4dr11010\plugins	ruesymmetry\source	ag	ruesymmetry.cpp(189) : error C2065: 't_data' : undeclared identifier  
\>  1>c:\users	he fosters\desktop\cinema4dr11010\plugins	ruesymmetry\source	ag	ruesymmetry.cpp(189) : error C2065: 'flags' : undeclared identifier  
\>  1>c:\users	he fosters\desktop\cinema4dr11010\plugins	ruesymmetry\source	ag	ruesymmetry.cpp(189) : error C2065: 'itemdesc' : undeclared identifier  
\>  1>Project : warning PRJ0018 : The following environment variables were not found:  
\>  

`

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/08/2009 at 08:22, xxxxxxxx wrote:

Need to see code. You are defining GetDEnabling() in the class itself and including the class header in the cpp file? Also, you should be including the plugin resource header ("Ttruesymmetry.h" I assume) in the class header. It can be done in the cpp file but restricts access to your resource descriptions to the tag code only.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/08/2009 at 08:30, xxxxxxxx wrote:

The problem is I am not using it properly in the source.cpp

I have figured out that I needed to replace "id" with the name of the element, in this case "MAKE_SYMMETRICAL" which is a button. I am not sure what to replace 'node', t_data", "flags", or "itemdesc", with. What are each of those things?
~Shawn

This is what I put in the source to call the function, thus the errors.

> `

  
\>  return TrueSymmetry::GetDEnabling(node, MAKE_SYMMETRICAL, t_data, flags, itemdesc);  
\>  

`

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/08/2009 at 08:38, xxxxxxxx wrote:

tried this.. in the source.cpp

> `

return TrueSymmetry::GetDEnabling(GeListNode*, MAKE_SYMMETRICAL, GeData&, flags, BaseContainer* );

`

and now I don't get the errors from before,

but I get this one.

1>c:\users he fosters\desktop\cinema4dr11010\plugins ruesymmetry\source ag ruesymmetry.cpp(189) : error C2059: syntax error : ','

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/08/2009 at 10:11, xxxxxxxx wrote:

You are not going about this in the correct way. You never call GetDEnabling() - it gets called for you. By overriding it in the plugin TagData class you created, it is called by Cinema 4D as needed (instead of the virtual one described in the TagData class - from NodeData from where it is derived). Note that at the end of my GetDEnabling() call, I actually call the TagData version so it can handle stock ones that I don't handle.

See the cinema4dsdk\source\object\circle.cpp for an example. Although it is an ObjectData plugin, the same basic principles are involved.