add custom propertie panel to a floating panel

is that possible to move the custom propertie panel into UI in 3d view or to add the custom propertie panel to a floating panel that stay on top of other windows?
the good exemple:
http://www.creativecrash.com/maya/tutorials/scripting/mel/c/how-to-use-attribute-collection-2-02-to-build-a-custom-ui

i did try that to add the custom propertie panel to the view_3d UI but no luck…

import bpy

class ObjectButtonsPanel():
bl_label = “test”
bl_options = {‘DEFAULT_CLOSED’}
bl_space_type = ‘VIEW_3D’
bl_region_type = ‘UI’
bl_context = “object”

def draw(self, context):
draw(self.layout, context, self._context_path, self._property_type)

class OBJECT_PT_custom_props(ObjectButtonsPanel, bpy.types.Panel):
COMPAT_ENGINES = {‘BLENDER_RENDER’, ‘BLENDER_GAME’}
_context_path = “object”
_property_type = bpy.types.Object

def register():
bpy.utils.register_class(OBJECT_PT_custom_props)

def unregister():
bpy.utils.unregister_class(OBJECT_PT_custom_props)

if name == “main”:
register()

look at the the mushroom script
it does but ahve to change as per API change
i’ll see if i have a working version but not certain

any let me know if you dont find it !

happy 2.5

ok found one

is this what you need



 
import random
import bpy
import math
import mathutils
from math import *
from bpy.props import *
 
#  Properties   definition
 
 
bpy.types.Scene.mystringproper1 = StringProperty(
name="Myfirststring1")
bpy.context.scene['mystringproper1'] = "This is my string prop"
bpy.types.Scene.Mybigfirststring1 = StringProperty(
name="Mybigfirststring1")
bpy.context.scene['Mybigfirststring1'] = "Road to Rome"
 
 
bpy.context.scene['firststring1'] = "Hello there"
 
print ('string propertie $$$$ mystringproper1  =',bpy.context.scene['mystringproper1'])    # Print the value of the string propertie
 
print ('string propertie $$$$ Mybigfirststring1  =',bpy.context.scene['Mybigfirststring1'])   # Print the value of the string propertie
print ('string propertie $$$$  firststring1 =',bpy.context.scene['firststring1'])      # Print the value of the string propertie
 
 
#   Scene properties  Definitons
 
bpy.types.Scene.manuf1 = StringProperty(
name="Manufacturer ")
bpy.context.scene['manuf1'] = "Thebigmanufacturer"
 
 
 
class proppanel1(bpy.types.Operator):
 
 bl_idname = "prop.panel1"
 bl_label = "Proppanel1"
 bl_options = {'REGISTER', 'UNDO'}
 dialog_width=500          # Window widht
 title_label_text=' This is the report'
 
 def invoke(self, context, event):
 
  bpy.context.mode!='EDIT_MESH'
 
  wm = bpy.context.window_manager
  wm.invoke_props_dialog(self, self.dialog_width)
 
 # http://www.blender.org/documentation/250PythonDoc/bpy.types.Context.html#bpy.types.Context.window_manager
 
  return {'RUNNING_MODAL'}
 
 def draw(self, context):
 
  layout = self.layout
  scene = context.scene
 
  props = self.properties
 
  layout.label(text=self.title_label_text)    #  Title of the panel
 
  layout.label(text="Curve Family Settings")
 
  col = layout.column()
  col.prop(scene, 'mystringproper1')
  col.prop(scene, 'Mybigfirststring1')
 
  col.prop(scene, 'manuf1')
 
  row = layout.row()
  split = row.split(percentage=0.5)
  colL = split.column()
  colR = split.column()
 
  layout.label(text=" Model : ")
  layout.label(text="Duty : ")
  layout.label(text="NB. Serial number   ")
 
  layout.label(text=" Country  ")
 
 def execute(self,context):
 
  print ('execute  method')
 
  return {'FINISHED'}
 
bpy.utils.register_class(proppanel1)
 

with spacebar just proppanel and that’s it it works fine

happy 2.5

interesting,
i have done that

import bpy

from rna_prop_ui import PropertyPanel

class ObjectButtonsPanel():
bl_space_type = ‘VIEW_3D’
bl_region_type = ‘UI’
bl_context = “object”

class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
COMPAT_ENGINES = {‘BLENDER_RENDER’, ‘BLENDER_GAME’}
_context_path = “object”
_property_type = bpy.types.Object

def register():
bpy.utils.register_class(OBJECT_PT_custom_props)

def unregister():
bpy.utils.unregister_class(OBJECT_PT_custom_props)

if name == “main”:
register()

Its verry bad but i got a custom propertie panel where i want. how to put that into your floating windows? I know my code is just a shame i don t really understantd what i have done.

By the way how do you put the text into a scrolling panel in the forum?

but how do you run this ?

is it wolrng in latest built i got 272 i think

happy 2.5

i run it from the text editor, and i use the R 35367.
you need to get an object in the scene.

here is a mockup

of course i supposed it s hard to do…

i mena how do you start it from the space bar ?

now i treid your little code and it does not work

what 's wrong with this ?


import bpy
from rna_prop_ui import PropertyPanel
class ObjectButtonsPanel():
 bl_space_type = 'VIEW_3D'
 bl_region_type = 'UI'
 bl_context = "object"
 
 
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
 COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 _context_path = "object"
 _property_type = bpy.types.Object
 
def register():
 bpy.utils.register_class(OBJECT_PT_custom_props)
 
 
def unregister():
 bpy.utils.unregister_class(OBJECT_PT_custom_props)
 
 
if __name__ == "__main__":
 pass
# register()
 
 
bpy.utils.register_class(ObjectButtonsPanel)
bpy.utils.register_class(OBJECT_PT_custom_props)
 
 
  
 

but you seemstto avhe fond another way to make it work which is interesting
happy 2.5

From the space bar I just typed “proppanel1”. This caused it to pop up.

with last script shown i get an error
but if i use the other one i don’t get any error but cannot find the propanel1?
so can you correct the script and pass it back so it works ok

but he way the word proppanel1 is not in the script so how can it find it ?

thanks happy 2.5

Mine is just a photoshop collage. i m not able to do that… It s more a proposal.

but did you succeed to make the little example you gave to work or not?

cause i never seen this example before and if it can work
wold like to see this

thanks

Your code does work, Ricky.

Paste Ricky’s first code block into a text window inside Blender.
Press ALT-P to run the code.
Move the mouse into the 3D window and press the spacebar.
Type “prop” into the search field.
Click on the word “proppanel1” in the list somewhere.
Then the window appears.

Here is the Ricky’s code running on 2.56 r35129.
This is not a photoshop mockup.

Attachments


sorry i was not refering to the first example i’v given i did that one so i know how it works!

but the one done like this


import bpy
from rna_prop_ui import PropertyPanel
 
class ObjectButtonsPanel():
 bl_space_type = 'VIEW_3D'
 bl_region_type = 'UI'
 bl_context = "object"
 
 
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
 COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 _context_path = "object"
 _property_type = bpy.types.Object
 
def register():
 bpy.utils.register_class(OBJECT_PT_custom_props)
 
 
def unregister():
 bpy.utils.unregister_class(OBJECT_PT_custom_props)
 
 
if __name__ == "__main__":
# pass
 register()
 
 
#bpy.utils.register_class(ObjectButtonsPanel)
#bpy.utils.register_class(OBJECT_PT_custom_props)
 

this one is not done like the one i did
so can this one works too?

it’s done otherwise then mine and i’d like to see this work if it can work at all !

thanks happy 2.5

yes it work.
paste it into the texte editor run script, and if you got at least a cube in the scene you will got a custom propertie button into the UI part of the VIEW_3D. the trouble is it has side effect… when you add properties it create a second propertie panel with just values…
but as i say it s just luck because i don t know what i m doing…

what appears in UI panel

can’t identify it ?

and what else can be done with this ?

does it add a new panel
can you add some buttons ior label may be that will show up better!

thanks

##you will see a taratata in the UI

import bpy
from rna_prop_ui import PropertyPanel

class ObjectButtonsPanel():
bl_space_type = ‘VIEW_3D’
bl_region_type = ‘UI’
bl_context = “object”
bl_label = “taratata”

class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
COMPAT_ENGINES = {‘BLENDER_RENDER’, ‘BLENDER_GAME’}
_context_path = “object”
_property_type = bpy.types.Object

def register():
bpy.utils.register_class(OBJECT_PT_custom_props)

def unregister():
bpy.utils.unregister_class(OBJECT_PT_custom_props)

if name == “main”:

pass

register()

#bpy.utils.register_class(ObjectButtonsPanel)
#bpy.utils.register_class(OBJECT_PT_custom_props)

there is a way to pass code with proper romat so we can copy back and run

go to advance mode place cursor where youw atn code to be added then click on top heaser on the # icon
and pass the code in between the worjd ]code]!

ok can see it now !

any other things that can be done with this kind of panel "

like it looks that if you add any fields it has to be done in first panel at the top of script?

i mean is there a way to make it non modal for isnance and add a button to turn it off?
or may be other things can be done !

still larening how to use this ?

is it possible for instance to call this panel from another script ?

thanks happy 2.5

if i add same feieds then in first script


 
import bpy
from rna_prop_ui import PropertyPanel
from mathutils import Vector
from bpy.props import *

bpy.types.Scene.mystringproper1 = StringProperty(
name="Myfirststring1")
bpy.context.scene['mystringproper1'] = "This is my string prop"
bpy.types.Scene.Mybigfirststring1 = StringProperty(
name="Mybigfirststring1")
bpy.context.scene['Mybigfirststring1'] = "Road to Rome"
 
 
bpy.context.scene['firststring1'] = "Hello there"
 
print ('string propertie $$$$ mystringproper1  =',bpy.context.scene['mystringproper1'])    # Print the value of the string propertie
 
print ('string propertie $$$$ Mybigfirststring1  =',bpy.context.scene['Mybigfirststring1'])   # Print the value of the string propertie
print ('string propertie $$$$  firststring1 =',bpy.context.scene['firststring1'])      # Print the value of the string propertie
 
 
#   Scene properties  Definitons
 
bpy.types.Scene.manuf1 = StringProperty(
name="Manufacturer ")
bpy.context.scene['manuf1'] = "Thebigmanufacturer"
 
 
 

class ObjectButtonsPanel():
 bl_space_type = 'VIEW_3D'
 bl_region_type = 'UI'
 bl_context = "object"
 bl_label = "taratata"
 def invoke(self, context, event):
 
  bpy.context.mode!='EDIT_MESH'
 
#  wm = bpy.context.window_manager
#  wm.invoke_props_dialog(self, self.dialog_width)
 
 # http://www.blender.org/documentation/250PythonDoc/bpy.types.Context.html#bpy.types.Context.window_manager
 
  return {'RUNNING_MODAL'}
 
 def draw(self, context):
 
  layout = self.layout
  scene = context.scene
 
  props = self.properties
 
  layout.label(text=self.title_label_text)    #  Title of the panel
 
  layout.label(text="Curve Family Settings")
 
  col = layout.column()
  col.prop(scene, 'mystringproper1')
  col.prop(scene, 'Mybigfirststring1')
 
  col.prop(scene, 'manuf1')
 
  row = layout.row()
  split = row.split(percentage=0.5)
  colL = split.column()
  colR = split.column()
 
  layout.label(text=" Model : ")
  layout.label(text="Duty : ")
  layout.label(text="NB. Serial number   ")
 
  layout.label(text=" Country  ")
 
 def execute(self,context):
 
  print ('execute  method')
 
  return {'FINISHED'}
 
 

class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
 COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 _context_path = "object"
 _property_type = bpy.types.Object
def register():
 bpy.utils.register_class(OBJECT_PT_custom_props)

def unregister():
 bpy.utils.unregister_class(OBJECT_PT_custom_props)

if __name__ == "__main__":
# pass
 register()


how can this be made to work ok ?

i don’t really see any call like in first script like

wm = bpy.context.window_manager
wm.invoke_props_dialog(self, self.dialog_width)

so does it call this pop up panel here ?

happy 2.5