On 12/04/2014 at 11:30, xxxxxxxx wrote:
Hi
I made small concept of realtime-switch command for simple brush tool
Based at py-tag at PointOp.
It simply switches mode between smear and if Shift pressed button - for smooth mode in brush tool
import c4d
from c4d import plugins
from c4d.gui import GetInputState
def lkmtest() :
bc = c4d.BaseContainer()
rs = GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, bc)
if rs and bc[c4d.BFM_INPUT_VALUE]:
return True
return False
def shft_pressed() :
bc = c4d.BaseContainer()
rs = GetInputState(c4d.BFM_INPUT_KEYBOARD, c4d.KEY_SHIFT, bc)
if rs and bc[c4d.BFM_INPUT_VALUE]:
return True
return False
def main() :
actidtool = doc.GetAction()
toolPlugins = plugins.FilterPluginList(c4d.PLUGINTYPE_TOOL, True)
if actidtool == 1016202:
for plugin in toolPlugins:
if plugin.GetName()=="Brush":
while lkmtest() :
if shft_pressed() :
plugin[c4d.MDATA_BRUSH_MODE]=c4d.MDATA_BRUSH_MODE_SMOOTH
c4d.EventAdd()
break
else:
plugin[c4d.MDATA_BRUSH_MODE] = c4d.MDATA_BRUSH_MODE_SMEAR
c4d.EventAdd()
break
Small question how can to replace FilterPluginList?
findPlugin does not work, seems