Help ... I don't get that with the * .res files, dialogs etc
So to internalize that:
A dialog is when I press a command for example and a window opens ... the res files belong in the dialogs folder
And with an object plugin e.g. or tag plugin, the parameters for setting, these are descriptions and these res files belong in the description folder
I'm so stupid, it really depresses me ...
I also copied the example files for the test, didn't change anything ....
I would like to create a very simple object plugin that simply creates a cube for the beginning and provides a real parameter that sets the side lengths .....
The plugin loads, the cube is displayed but my parameters and my group are not .... what am I doing wrong ..... the manuals for Python are confusing, dialogs are shown, but not for descriptions .....
This is the code for the plugin
import c4d
import os
PLUGIN_ID = 1000001 #test ID
class Cube_Maker(c4d.plugins.ObjectData):
def Init(self, node):
self.cube = c4d.BaseObject(c4d.Ocube)
self.cube.SetPhong(True, True, c4d.utils.DegToRad(45))
return True
def GetVirtualObjects(self, op, hh):
return self.cube
def GetDimensions(self, op, mp, rad): # I don't know just tried :-)
mp = c4d.Vector(40)
rad = c4d.Vector(40)
return
if __name__ == "__main__":
path, file = os.path.split(__file__)
fn = os.path.join(path,"res","window_maker.tif")
bmp = c4d.bitmaps.BaseBitmap()
bmp.InitWith(fn)
checker=c4d.plugins.RegisterObjectPlugin(id=PLUGIN_ID,
str="Cube",
g=Cube_Maker,
description="",
icon=bmp,
info=c4d.OBJECT_GENERATOR)
if checker:
print("Window Maker Ready")
this is the code for the MYDIALOG.h file:
#ifndef _MYDIALOG_H_
#define _MYDIALOG_H_
enum
{
SIDE = 1001
}
#endif
this is the code for the MYDIALOG.res file:
CONTAINER MYDIALOG
{
NAME MYDIALOG;
INCLUDE Obase;
INCLUDE Mpreview;
GROUP CUBE_PROPERTIES
{
REAL SIDE{ UNIT METER; MIN 0.0; }
}
}
this is the code for the MYDIALOG.str file:
STRINGTABLE MYDIALOG
{
MYDIALOG "Cube-Maker";
SIDE "Side-Length";
}
and the c4d.symbols file:
enum
{
// string table definitions
_DUMMY_ELEMENT_
};
here is my PluginStructure:
The plugin at the moment starts, loads ..I just want to show the group and the parameter , for the start without any function...just a real value
I am aware that I am sure that I am doing a lot wrong and that I have forgotten some things ... but the plugin concept is completely new to me ...:cry:
Sincerely
Tom