I am trying to restrict the selection an user can make for a text object and a curve object
what can i do to restrict the choices for the prop_search commands? When the user clicks in the Text Object box, i want to show him just the text objects available, same with the path object box, just show path objects.
import bpy
class FOLLOWINGLETTERS_Panel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Following Letters Panel"
bl_idname = "FOLLOWINGLETTERS_hello"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
# Add properties to all objects in Scene
bpy.types.Scene.obj_property = bpy.props.FloatProperty(name = "TextThickness")
def draw(self, context):
layout = self.layout
scene = context.scene
layout.prop_search(scene, "theTextObject", scene, "objects", text="Text Object", icon='OUTLINER_OB_FONT')
TextObj = scene.objects[scene.theTextObject]
print(TextObj.name)
layout.prop_search(scene, "thepathObject", scene, "objects", text="Path Object", icon='OUTLINER_OB_CURVE')
PathObj = scene.objects[scene.thepathObject]
print(PathObj.name)