Page 1 of 1

modulos

Posted: Mon May 01, 2006 4:43 pm
by gnoma
estoy intentando adaptar algunos modulos que me interesan pero a?adiendo o quitando cosas seg?n mis necesidades. alguno son faciles pero cuando entran scripts ya me lio un poco , me aclaro mas con los objetos.
El caso es que estoy modificando el modul PLOW3 y e cambiado para que reaccione al contraste con la entrada de audio. hasta aqu? bien, peor me gustar?a cambiar los dos knobs de posici?n x & y por dos slider de ganancia de audio para +x, +y & +z de Scale.(en lugar de unScale general).

e realizado algunos intentos, mirando bien el codigo pero no se por donde empezar o que hago mal.


gracias de antemano.

un saludo.

Juanjo

solucionado

Posted: Tue May 02, 2006 10:35 am
by gnoma
ya e solucionado el tema, era bastatnte sencillo. solo hac?a falta ller un poquito el manual :wink:
ahora quiero mas... quiero customizar el modulo TRASFORM 8 SM a por lo menos 16 o mas presets ya que 8 se me queda corto. el problema es que no veo como se crea la parte oculta de edit your preset.
ya se que puedo duplicar el modulo y crear mas presets, pero es que me gusta lo dif?cil :lol:

como puedo modifcar esta parte?
esto es lo que e editado en init():
_____________

preferences = module.getDefaults()

module.hideGroup('snap')
module.showGroup('apply')

#create the default value preferences of the module
def getDefPreset ():

presetList = []
for add in range(16) :# 16 preset
preset = [{},{},{},{'type':0,'on':0}]
for key in modul8.getValue('direct_keywords',0) :

keysplit = key.split('_')

if len(keysplit) >= 5 :
if keysplit[3] == 'matrix' : preset[0][key] = 0
elif keysplit[3] == 'patch' : preset[1][key] = 0
elif keysplit[3] == 'particle' : preset[2][key] = 0

presetList.append (preset)
presetsNames = {'0':'','1':'','2':'','3':'','4':'','5':'','6':'','7':'','8':'','9':'','10':'','11':'','12':'','13':'','14':'','15':''}

return ({'presetList': presetList,'presetsNames': presetsNames})
##



#Init the default, when the module is started the fist time (no preferences)
if preferences == {} :
preferences = getDefPreset()

#Init the default
presetList = preferences['presetList']
presetsNames = preferences['presetsNames']

#init the names of the preset
for key,value in presetsNames.items() :
module.setValue (key,0,value)
module.setAttribute('apply'+key,'CAPTION', str(value))


___________________

y la parte de message event(msg,param):
______________________

#split the message (action type, preset number)
msgSplit = msg.split('_')

#APPLY
if msgSplit[0] == 'apply' and param['value'] == 1 :

presetNumber = int(msgSplit[1])

print presetNumber

presetType = presetList[presetNumber][3]['type']
presetOn = presetList[presetNumber][3]['on']

#change the transformers parameters : on and type
modul8.setValue ('ctrl_layer_transformer_type', presetType,0)
modul8.setValue ('ctrl_layer_transformer_on', presetOn,0)

dict = presetList[presetNumber][presetType]

#change the transformers parameters
for key, value in dict.items() :
if modul8.getValue (key,0) != value : #chage only if the target is different (faster)
modul8.set15lue (k15,value,0)

#SNAPSHOT
elif msgSplit[0] == 'snap' and param['value'] == 1 :

presetNumber = int(msgSplit[1])
presetType = modul8.getValue ('ctrl_layer_transformer_type',0)
presetOn = modul8.getValue ('ctrl_layer_transformer_on',0)

#on and type
presetList[presetNumber][3]['type'] = presetType
presetList[presetNumber][3]['on'] = presetOn

#parameters
dict = presetList[presetNumber][presetType]
for key in dict :
dict[key] = modul8.getValue (key,0)

#Change the name
elif msgSplit[0] == 'presetName' :
presetsNames[param['NAME']] = param['text']
module.setAttribute(msgSplit[1],'CAPTION', str(param['text']))

#Swap to edit mode
elif msg == 'edit' :
if param['value'] :
module.hideGroup('apply')
module.showGroup('snap')
else :
module.hideGroup('snap')
module.showGroup('apply')

#Init
elif msg =='reset' and param['value'] == True :

preferences = getDefPreset()
#Init the default
presetList = preferences['presetList']
presetsNames = preferences['presetsNames']

#init the names of the preset
for key,value in presetsNames.items() :
module.setValue (key,0,value)
module.setAttribute('apply'+key,'CAPTION', str(value))

#Save
elif msg =='save' and param['value'] == True :
module.setDefaults ( {'presetList': presetList,'presetsNames': presetsNames} )

__________________________


el caso es que no consigo ver donde se genera el men? edit.

se aecptan camentarios.


gracias