THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/10/2006 at 04:44, xxxxxxxx wrote:
Cinema 4D Version: R9.507
Platform: Windows ;
Language(s) : C++ ;
i created a Command Plugin with an execute funtion, that creates some primitives. I am already able to access some properties like position, scale or rotation. Now i want to modify the object parameters like radius, height or orientation. Can someone describe if and how it's possible to do that?
Thanks a lot for helping me
PS: This is an extract of my plugin:
Bool CC_0::Execute (BaseDocument* doc)
BaseObject *op_0, *op_tube;
Vector pos_tube (0,0,0), scl (1,1,-1), rot (0,pi/2,0);
op_0 = BaseObject::Alloc(Onull);
op_tube = BaseObject::Alloc(Otube);
On 21/10/2006 at 05:19, xxxxxxxx wrote:
Since these parameters show in the Attributes Manager, they are in the object's BaseContainer as Description Resources:
BaseContainer* bc = op_tube->GetDataInstance();
Now, what to look for is the tricky part (for novices). In this case, you need to go to the 'resource/modules/objects/res/description' folder and find the .res file for the primitive object (Otube.res, for instance). These are the object's attributes - showing the type and id for each attribute (e.g.) :
You can get and set these attributes using the BaseContainer methods (e.g.) :
Real myRad = 2.0;
myRad = bc->GetReal(PRIM_TUBE_IRAD);
On 21/10/2006 at 05:59, xxxxxxxx wrote:
Thanks a lot. This solved my problem.
On 21/10/2006 at 06:45, xxxxxxxx wrote:
Ok that works. The only thing i can't edit is the orientation. In otube.res it is included:
Default orientation is +Y but i need -Y. I can change it by modifiing the rotation of the object but then i change the orientation of my co-ordinate system too. So it would be better to change only the orientation of the object.
Thanks for your help
On 21/10/2006 at 08:18, xxxxxxxx wrote:
Oprimitiveaxis is a reference to another resource file. In it you will find the type/id and the settings (for the drop down list).