On 09/03/2015 at 10:53, xxxxxxxx wrote:
Hello guys. Sorry if this is confusing, there's lots of stuff going on.
Any ways, I am creating a c4d.OBJECT_GENERATOR with VirtualObject;
In the User Interface I want to have controls that are available in Extrude Nurbs object (Movement, Subdivisions, Caps etc) + my custom controls. So my res file looks like this:
CONTAINER Omyplugin
{
NAME Omyplugin;
INCLUDE Obase;
GROUP ID_OBJECTPROPERTIES
{
INCLUDE Oextrude; # <------- This is where I add Extrude Nurbs controls
}
GROUP GROUP_MESH # <---------- My custom controls are in new tab
{
LINK LINK_PROFILESPLINE { ACCEPT { Ospline; Osplinecircle; Osplineprofile; Osplinecontour; Osplinerectangle;
Osplinestar; Osplinecogwheel; Osplineflower; Osplinetext; Ospline4side; Osplinenside; 440000054; 1019396; } }
REAL MY_NUMBER { MIN 2; MAX 10000; STEP 1; UNIT REAL; }
.. etc
}
}
.h file is like this:
#ifndef _Omyplugin_H_
#define _Omyplugin_H_
enum
{
GROUP_MESH = 9000, # <------ Tab name
LINK_PROFILESPLINE = 1000, # <------- Instance object
MY_NUMBER = 1001,
...etc
};
#endif
.str file:
STRINGTABLE Omyplugin
{
Omyplugin "Spline Object";
GROUP_MESH "Generate";
LINK_PROFILESPLINE "Spline Object";
MY_NUMBER "Number of Slices";
..etc
Then in .pyp file right after "import c4d" and other imports I declare my controls "LINK_PROFILESPLINE = 1000, MY_NUMBER = 1001" etc and set default value for them like this
class MYPLUGIN(plugins.ObjectData) :
def __init__(self) :
self.SetOptimizeCache(True)
def Init(self, op) :
# Set default values
op[MY_NUMBER] = 10 # <---------- Set 10 as default value
...etc
NOW THE PROBLEM is that MY NUMBER values updates when changing values in SUBDIVISIONS and vice versa. I DON"T WANT IT!!!
I probably missed something, didn't initiate Oextrude controls or something - but I have no idea how to do that. What am I missing?
Thank you