Where is the best place in blender to create a GUI for a character

Hello everyone,

this was a test to put it in the UI of the panel 3D-view but It’s not working the way I want, I’m loosing the info when I close it… so skip the 3 next post to reply to this question, where is the best place in blender to create a GUI for a character

So, I’m trying to have a Enum in the 3D_view panel and I was able to accomplish that by coping a script that I found on the forum and updating it… (in fact simplifying it a lot :evilgrin:) but this enum is connected to a list in the scene, which I’m able to get in the driver, using the path.

The only problem with this code, and the list in the scene, is that it doesn’t update real time, it only updates when I play with the timeline…

So I would like to know how I can do exactly the same thing but having it being updated in real time, as soon as I change it. (I’d like to have that for setting the smooth on an object for example.)

Also I would like to know if it’s possible to have this variable connected to a specific object in the scene. for now I only see the different button in the UI being connected to context.active_object.

import bpy

def objectsnames():
    
    items = "(('0','choice00',''),('1','choice01',''),('2','choice02',''))"
    myitems = eval(items)
    
    return myitems
  
               
class OBJECT_PT_hello(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_label = "Enum test"

    myitems = objectsnames()
    bpy.types.Scene.list = bpy.props.EnumProperty(name="Objects",items=myitems)
    
    def draw(self, context):
        layout = self.layout

        row = layout.row()
        row.prop(context.scene, "list")

def register():
    bpy.utils.register_class(OBJECT_PT_hello)
def unregister():
    bpy.utils.unregister_class(OBJECT_PT_hello)

if __name__ == "__main__":
    register()

Thank you for your help!

Mathias.


import bpy

def objectsnames():
    
    items = "(('0','choice00',''),('1','choice01',''),('2','choice02',''))"
    myitems = eval(items)
    
    return myitems

def updateParameter(self,context):
    print("User made new selection.")  
               
class OBJECT_PT_hello(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_label = "Enum test"

    myitems = objectsnames()
    bpy.types.Scene.list = bpy.props.EnumProperty(name="Objects",items=myitems, update=updateParameter)
    
    def draw(self, context):
        layout = self.layout

        row = layout.row()
        row.prop(context.scene, "list")

def register():
    bpy.utils.register_class(OBJECT_PT_hello)
def unregister():
    bpy.utils.unregister_class(OBJECT_PT_hello)

if __name__ == "__main__":
    register()

thanks guy!

sorry, batFINGER, I can see how it’s not making a lot of sens! sorry about that!

it worked with the script from Atom when I put that in the updateParameter.

def updateParameter(self,context):
bpy.data.scenes[‘Scene’].frame_current=bpy.data.scenes[‘Scene’].frame_current+1
bpy.data.scenes[‘Scene’].frame_current=bpy.data.scenes[‘Scene’].frame_current-1

But now, I noticed that when I save my file, and reopen it, I lose my UI in the 3d_View panel, so I execute the script, but my driver is not update by the script and so I need to update it manually, which is ok for one, but I just imagine if I have a lot, It won’t be very useful.

Is there a way to save everything in the file to also keep the UI that I created?

Just to simplify everything, here is what I’m looking for:

Where is the best place in blender to create a GUI for a character Rig.

I need sliders, button on/off, button with enum. and all of them connected to different object of the rig.

I think the best would be to have a window that we can open and close as we want, and the variables of that window being connected to Custom propertie of the object. but I don’t know if it’s possible.

What do you think?

about the script saved in py and the register… that´s perfect, that´s going to help me a lot.

For now I was look at something that would drive the smooth level of all my object in a rig. But it´s more like a test for now to see how I´m going to devellop my rigs.

thanks btw batFINGER, it´s really helpful!

It´s not possible for now to create a window in blender, is it?

Mathias.