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

Size of empty polygon object is not increased.

Author
Message
  Topic Search Topic Search
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 46
Direct Link To This Post Topic: Size of empty polygon object is not increased.
    Posted: 2018 Mar 06 at 1:50am

User Information:

Cinema 4D Version:   R19 
Platform:   Windows  ;   
Language(s):     C++  ;   

---------

Hi Everyone,

I have created empty polygon object using the below code.

BaseObject* const polygonobj = BaseObject::Alloc(Opolygon);

The plane is created successfully but its size always showing 0. I have tried to increase the size but I don't get the proper result. Please give me some idea why it is not increasing.
Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1143
Direct Link To This Post Posted: 2018 Mar 07 at 1:27am
Hi,

Your code is maybe just lacking a call to Message(MSG_UPDATE) after the polygon object is changed.
Rounded Tube SDK example calls it like this.



MAXON
Developer Support
Back to Top
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 46
Direct Link To This Post Posted: 2018 Mar 07 at 5:53am
I have tried but not getting the proper result.
Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1143
Direct Link To This Post Posted: 2018 Mar 07 at 6:39am
Where are you doing this? Could you share some code?



MAXON
Developer Support
Back to Top
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 46
Direct Link To This Post Posted: 2018 Mar 07 at 9:29am
Thank you so much, Yannick Puech. Just now the issue is resolved. I have changed the value of the Cpolygon parameters. I have one more doubt there is any special API to change the color of material that is applied on texture tag. I have found some code to change the color of the object but it is not working with texture tag. I am copying the sample code.

   ObjectColorProperties ocp;

ocp.usecolor = 1;

ocp.color = Vector(0.5, 0.0, 0.0);

ocp.xray = FALSE;

cubeObject->SetColorProperties(&ocp);

cubeObject->Message(MSG_UPDATE);
Back to Top
mp5gosu View Drop Down
Member
Member


Joined: 2009 Mar 12
Online Status: Offline
Posts: 88
Direct Link To This Post Posted: 2018 Mar 08 at 4:12am
As you mentioned, you have a material applied. And of course, you'll have to change the diffuse color of the material (either color channel or PBR->Reflectance channel, Diffuse base layer color)
Your object does have a texture tag applied, so you are able to access the linked material via GetMaterial().

From there, you are able to alter the materials' parameters.


Edited by mp5gosu - 2018 Mar 08 at 4:18am
Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1143
Direct Link To This Post Posted: 2018 Mar 08 at 6:40am
ObjectColorProperties is used for object's Display Color parameter.
As already explained by mp5gosu, to change the color of the material applied to an object, access the material from its TextureTag.


If you have any other question related to another topic different than the original, please post a new thread.



MAXON
Developer Support
Back to Top

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.109 seconds.