Im tryin hard to draw an operator of my own as a slider but i dont know how, is it possible?
I would like to execute the operator when the slider moves, or a numeric value changes instead pressing the button that the panel creates.
Thanks in advance.
I have another related question.
With blender 2.49 we could drive an objects location mathematically by using script links,
for example, we could tell the objects location in Z to be equal to sin(Location in X). And script links reflected the changes everytime i moved the object.
With 2.49 we could also achieve this with a script constraint.
Is this posible with 2.5 operators or not yet?.
En cristiano: No lo he comprobado pero supongo que funcionará: En el código del panel pones un if() que mira el valor del slider property (probablemente un IntProperty o un FloatProperty) y lo compara con el viejo valor que almacenas en una variable global y si ha cambiado almacena el nuevo valor en la variable global y llama al operador. El operador se llama con bpy.ops.nombredeloperador()
Si no te va pega el codigo y le echo un vistazo.
De la segunda pregunta no tengo ni idea.
I didn’t tested yet but I think it will work: In panel code use if() to test slider property value (Int or FloatProperty sure) and compares against the old value stored in a global variable. Then if the value changed you store the new value in the global variable and you call the operator this way: bpy.ops.operatorname() . Post the code if it doesn’t works.
Second question I have not idea.
The problem that I have run into is that even if you cobble together a hack that works and manages your object when the frame changes, you still can not render the result because bpy.context.scene falls out of scope upon render. I reported it as a bug and it was acknowledged and assigned. That was weeks ago and all has fell silent.
Here is a link to my most recent attempt: (to change the copy of a font when the frame changes)
i think you can have a float or int button which calls an operator
that can be done as i know of
but you cannot assign a value to a propertie float or int
i hope they will take into consideration this and be able to do that but not certain if the GUI can be modifier to assign values to properties in panel cause it is considered right now as out of context !
First of all thanks for the answers. This was making me crazy.
@Bao2 en cristiano: Es buena idea, definitivamente lo probare. He estado intentado algo similar como que cuando el panel refresca o se redibuja ejecute una funcion sin exito ya que actualmente no se pueden invocar funciones desde el redibujado del panel.
@Bao2: Its a good idea, ill try that. Ive been trying something similar like invoking a function of my own placed at the panels draw section without success.
@Atom: Thats great, very close to what we need. Its a clear example of what the old script links did. handling the framechange event.
It would be great if we could do the same by listening to the redraw event. Ill try those approaches and come back with the results.
Bat Finger put together another possible solution here: