THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/07/2011 at 15:14, xxxxxxxx wrote:
So I'm trying to get a simple Object Plugin to work and I've got it so it's almost there but I keep getting an error when I launch the plugin in C4D. The plug does work but I can't figure out why it keeps throwing this error when it is launched:
Thanks for taking a look.
The directory structure is:
Othreadconnect/
ThreadConnect.pyp
res/
c4d_symbols.h
description/
Othreadconnect.h
Othreadconnect.res
strings_us/
dialogs/
Othreadconnect.str
othreadconnect.tif
This is the code:
ThreadConnect_b02.pyp
#!/usr/bin/env python
# encoding: utf-8
"""
ThreadConnect_b02.pyp
"""
import sys
import os
import math
import c4d
from c4d import plugins, utils, bitmaps
Plugin_ID=1000005
class ThreadConnect(plugins.ObjectData) :
'''Thread Connect Generator'''
def __init__(self) :
self.SetOptimizeCache(True)
def Init(self, op) :
self.InitAttr(op, int, [10001])
op[10001]= 8
return True
if __name__ == '__main__':
dir, file = os.path.split(__file__)
bmp = bitmaps.BaseBitmap()
fn = os.path.join(dir, "res", "othreadconnect.tif")
bmp.InitWith(fn)
plugins.RegisterObjectPlugin(id = Plugin_ID,
str = "Thread Connect Beta .02",
g = ThreadConnect,
description = "Othreadconnect",
info = c4d.OBJECT_GENERATOR,
icon = bmp)
Othreadconnect.res
CONTAINER Othreadconnect
{
NAME Othreadconnect;
INCLUDE Obase;
GROUP ID_OBJECTPROPERTIES
{
LONG POINTS
{
MIN 1;
}
}
}
Othreadconnect.h
#ifndef _Othreadconnect_
#define _Othreadconnect_
enum
{
POINTS = 10001
};
#endif
c4d_symbols.h
enum
{
// End of symbol definition
_DUMMY_ELEMENT_
};
Othreadconnect.str
DIALOGSTRINGS Othreadconnect
{
Othreadconnect "Thread Connect";
POINTS "Number of Points";
}