I am very new to scripting in modul8 and not to mention python itself - feeling like in flying circus at all :]
I have problem to solve - neverending scrolling line of names specified from external file. This was not so difficult I've just used two text layers, split properly text into different text fields, give layers motion - so far no problem.
but serious problem is that info_layer_media_pixelSize_x doesn't return correct pixel size of text layer - sometimes it do, sometimes it does not - so I am not able to synchronize layers motion and position properly.
to find where my problem was i wrote this script - just to read values one by one from list and align them to the left
Code: Select all
#text field itself
textField = ['basdfadsgdfsgsdfgdfsg','asdfasdfasdfasdfsd','2345435dfsgcvbxcer554t','asdgdfgsdfxcvdfsgdgfsdfgfdg','gsdfgsdfgsdfgsdfg']
#number of elements and active index
maxField = len(textField)
actidxField = 0
#resolution and text size
resolution_x = 800.0
textSize = 25.0
#setting text layer text size
modul8.setValue('direct_layer_text_size',textSize,0)
###########################################
def TextChange () :
global actidxField, textField
text=''
if actidxField >= maxField :
actidxField = 0
text = '__' + textField[actidxField] + '__'
actidxField += 1
modul8.setValue('direct_layer_position_x',0.0,0)
modul8.setValue('direct_layer_text_field',text,0)
def TextLeft () :
size = modul8.getValue('info_layer_media_pixelSize_x',0)
posX = -(resolution_x / 2)+(size/2)
modul8.setValue('direct_layer_position_x',posX,0)
###########################################
TextChange()
TextLeft ()
and for button with 'CHANGE' message
Code: Select all
if msg == 'CHANGE' :
TextChange()
TextLeft ()
it seems to me like info_layer_media_pixelSize_x is returning pixel size of previous text field - but pls do not take this seriously.
using version 2.6.1
any help would be great. I am lost.
thanx a lot