-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin-deformer.sublime-snippet
88 lines (58 loc) · 2.11 KB
/
plugin-deformer.sublime-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<snippet>
<content><![CDATA[
"""
Plugin name : $1
Copyright:
Written for CINEMA 4D Rxx.xxx
Modified Date:
"""
import os
import sys
import c4d
from c4d import plugins, utils, bitmaps, gui
# Be sure to use a unique ID obtained from www.plugincafe.com
# 1000001-1000010
PLUGIN_ID = 1000001
class $1(plugins.ObjectData):
"""docstring for $1"""
def Message(self, node, type, data):
return True
def Init(self, op):
return True
def GetDimension(self, op, mp, rad):
#Return the boundaries of your object.
pass
def GetHandleCount(op):
#Called to get the number of handles the object has
return $1.HANDLECOUNT
def GetHandle(self, op, i, info):
#Called to get the information for handle
pass
def DetectHandle(self, op, bd, x, y, qualifier):
#Manually detect a click on a handle
return
def MoveHandle(self, op, undo, mouse_pos, hit_id, qualifier, bd):
#Move a handle manually
return True
def Draw(self, op, drawpass, bd, bh):
#Called when the display is updated for you to display some visual element of your op in the 3D view
return c4d.DRAWRESULT_OK
return c4d.DRAWRESULT_SKIP
def ModifyObject(self, mod, doc, op, op_mg, mod_mg, lod, flags, thread):
#This is called when your plugin should modify the passed object.
return True
if __name__ == "__main__":
path, fn = os.path.split(__file__)
bmp = bitmaps.BaseBitmap()
bmp.InitWith(os.path.join(path, "res", "$2.tif"))
plugins.RegisterObjectPlugin(id=PLUGIN_ID, str="Py-$1",
g=$1,
description="$2", icon=bmp,
info=c4d.OBJECT_MODIFIER)
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cinemaPlugin Object Deformer</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.pythonAPI.cinema4D</scope>
<description> Deformer structure</description>
</snippet>