On 13/02/2018 at 11:47, xxxxxxxx wrote:
(Object Generator Plugin in Python for Cinema 4D R19.024 on macOS Sierra)
Hello Everyone!
I'm not able to delete points (in point mode) of a custom point object generator.
It will result in the following error:
[
](https://www.dailywritingtips.com/forum/misc.php?s=aeda5b5f578c54e23f4eaebbeb9c8d3b&do=bbcode#code)
Modeling Kernel Error : Invalid Object
Modeling Kernel Error : Failed
[
](https://www.dailywritingtips.com/forum/misc.php?s=aeda5b5f578c54e23f4eaebbeb9c8d3b&do=bbcode#code)
See the code below for a simplified example.
Point handles will not be drawn in the example code. Move the mouse pointer over the beginning or the end of the line, to select a point when in point mode.
Best regards
Tim
PS: I'm new to Cinema 4D plugin development and new to Cinema 4D in general.
[
](https://www.dailywritingtips.com/forum/misc.php?s=aeda5b5f578c54e23f4eaebbeb9c8d3b&do=bbcode#code)
import math
import sys
import os
import c4d
from c4d import bitmaps, gui, plugins, utils
PLUGIN_ID = 9199191
class TestPlugin(plugins.ObjectData) :
def Init(self, node) :
node.ResizeObject(4)
node.SetPoint(0, c4d.Vector( 0.0, 0.0, 0.0))
node.SetPoint(1, c4d.Vector(100.0, 0.0, -100.0))
node.SetPoint(2, c4d.Vector(200.0, 0.0, 100.0))
node.SetPoint(3, c4d.Vector(300.0, 0.0, -100.0))
return True
def GetVirtualObjects(self, op, hierarchyhelp) :
dirty = op.CheckCache(hierarchyhelp) or op.IsDirty(c4d.DIRTY_DATA)
if dirty is False: return op.GetCache(hierarchyhelp)
splineObj = c4d.SplineObject(op.GetPointCount(), c4d.SPLINETYPE_LINEAR)
splineObj.SetAllPoints(op.GetAllPoints())
return splineObj
if __name__ == "__main__":
path, file = os.path.split(__file__)
bmp = bitmaps.BaseBitmap()
bmp.InitWith(os.path.join(path, "res", "some.tif"))
plugins.RegisterObjectPlugin(
id = PLUGIN_ID,
str = "Py-TestPlugin",
g = TestPlugin,
description = "Opytestplugin",
icon = bmp,
info = c4d.OBJECT_GENERATOR | c4d.OBJECT_POINTOBJECT )
[
](https://www.dailywritingtips.com/forum/misc.php?s=aeda5b5f578c54e23f4eaebbeb9c8d3b&do=bbcode#code)