Skip to content
Snippets Groups Projects
ui.py 64.2 KiB
Newer Older
  • Learn to ignore specific revisions
  •                 if func > 3:
                        row.prop(tex.pov, "func_P3", text="P3")
                    row=layout.row(align=align)
                    if func > 4:
                        row.prop(tex.pov, "func_P4", text="P4")
                    if func > 5:
                        row.prop(tex.pov, "func_P5", text="P5")
                    row=layout.row(align=align)
                    if func > 6:
                        row.prop(tex.pov, "func_P6", text="P6")
                    if func > 7:
                        row.prop(tex.pov, "func_P7", text="P7")
                        row=layout.row(align=align)
                        row.prop(tex.pov, "func_P8", text="P8")
                        row.prop(tex.pov, "func_P9", text="P9")
            ###################################################End Patterns############################
    
    
                layout.prop(tex.pov, "warp_types", text="Warp types") #warp
                if tex.pov.warp_types == "TOROIDAL":
                    layout.prop(tex.pov, "warp_tor_major_radius", text="Major radius")
                if tex.pov.warp_types not in {"CUBIC","NONE"}:
                    layout.prop(tex.pov, "warp_orientation", text="Warp orientation")
                col = layout.column(align=align)
                row = col.row()         
                row.prop(tex.pov, "warp_dist_exp", text="Distance exponent")        
                row = col.row()
                row.prop(tex.pov, "modifier_frequency", text="Frequency")
                row.prop(tex.pov, "modifier_phase", text="Phase")
    
                row=layout.row()
    
                row.label(text="Offset:")
                row.label(text="Scale:")
                row.label(text="Rotate:")
                col=layout.column(align=align) 
                row=col.row()
                row.prop(tex.pov, "tex_mov_x", text="X")
                row.prop(tex.pov, "tex_scale_x", text="X")
                row.prop(tex.pov, "tex_rot_x", text="X")
                row=col.row()
                row.prop(tex.pov, "tex_mov_y", text="Y")
                row.prop(tex.pov, "tex_scale_y", text="Y")
                row.prop(tex.pov, "tex_rot_y", text="Y")
                row=col.row()
                row.prop(tex.pov, "tex_mov_z", text="Z")
                row.prop(tex.pov, "tex_scale_z", text="Z")
                row.prop(tex.pov, "tex_rot_z", text="Z")
                row=layout.row()
    
                row.label(text="Turbulence:")
                col=layout.column(align=align) 
                row=col.row()
                row.prop(tex.pov, "warp_turbulence_x", text="X")
                row.prop(tex.pov, "modifier_octaves", text="Octaves")
                row=col.row()
                row.prop(tex.pov, "warp_turbulence_y", text="Y")
                row.prop(tex.pov, "modifier_lambda", text="Lambda")
                row=col.row()
                row.prop(tex.pov, "warp_turbulence_z", text="Z")
                row.prop(tex.pov, "modifier_omega", text="Omega")
            
    
    class TEXTURE_PT_povray_tex_gamma(TextureButtonsPanel, bpy.types.Panel):
        bl_label = "Image Gamma"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
    
        def draw_header(self, context):
            tex = context.texture
    
    
            self.layout.prop(tex.pov, "tex_gamma_enable", text="", icon='SEQ_LUMA_WAVEFORM')
    
    
        def draw(self, context):
            layout = self.layout
    
            tex = context.texture
    
    
            layout.active = tex.pov.tex_gamma_enable
            layout.prop(tex.pov, "tex_gamma_value", text="Gamma Value")
    
    Maurice Raybaud's avatar
    Maurice Raybaud committed
    
    
    #commented out below UI for texture only custom code inside exported material:
    # class TEXTURE_PT_povray_replacement_text(TextureButtonsPanel, bpy.types.Panel):
        # bl_label = "Custom POV Code"
        # COMPAT_ENGINES = {'POVRAY_RENDER'}
    
        # def draw(self, context):
            # layout = self.layout
    
            # col = layout.column()
            # col.label(text="Replace properties with:")
            # col.prop(tex.pov, "replacement_text", text="")
    
    Maurice Raybaud's avatar
    Maurice Raybaud committed
    class OBJECT_PT_povray_obj_importance(ObjectButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
    
    
    Thomas Dinges's avatar
    Thomas Dinges committed
            col = layout.column()
            col.label(text="Radiosity:")
    
            col.prop(obj.pov, "importance_value", text="Importance")
    
    Thomas Dinges's avatar
    Thomas Dinges committed
            col.label(text="Photons:")
    
            col.prop(obj.pov, "collect_photons", text="Receive Photon Caustics")
    
            if obj.pov.collect_photons:
                col.prop(obj.pov, "spacing_multiplier", text="Photons Spacing Multiplier")
    
    class OBJECT_PT_povray_obj_sphere(PovDataButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray Sphere"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        #bl_options = {'HIDE_HEADER'}
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            obj = context.object
            return (obj and obj.pov.object_as == 'SPHERE' and (engine in cls.COMPAT_ENGINES))    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            
            col = layout.column()
    
            if obj.pov.object_as == 'SPHERE':
                if obj.pov.unlock_parameters == False:
                    col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED') 
                    col.label(text="Sphere radius: " + str(obj.pov.sphere_radius))
    
                else:
                    col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED') 
                    col.label(text="3D view proxy may get out of synch")
                    col.active = obj.pov.unlock_parameters
                    
    
                    layout.operator("pov.sphere_update", text="Update",icon="SOLID")        
                    
                    #col.label(text="Parameters:")
                    col.prop(obj.pov, "sphere_radius", text="Radius of Sphere")
    
    
    
    class OBJECT_PT_povray_obj_cylinder(PovDataButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray Cylinder"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        #bl_options = {'HIDE_HEADER'}
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            obj = context.object
            return (obj and obj.pov.object_as == 'CYLINDER' and (engine in cls.COMPAT_ENGINES))    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            
            col = layout.column()
    
            if obj.pov.object_as == 'CYLINDER':
                if obj.pov.unlock_parameters == False:
                    col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED') 
                    col.label(text="Cylinder radius: " + str(obj.pov.cylinder_radius))
                    col.label(text="Cylinder cap location: " + str(obj.pov.cylinder_location_cap))
    
                else:
                    col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED') 
                    col.label(text="3D view proxy may get out of synch")
                    col.active = obj.pov.unlock_parameters
                    
    
                    layout.operator("pov.cylinder_update", text="Update",icon="MESH_CYLINDER")        
                    
                    #col.label(text="Parameters:")
                    col.prop(obj.pov, "cylinder_radius")
                    col.prop(obj.pov, "cylinder_location_cap")
    
    
    class OBJECT_PT_povray_obj_cone(PovDataButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray Cone"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        #bl_options = {'HIDE_HEADER'}
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            obj = context.object
            return (obj and obj.pov.object_as == 'CONE' and (engine in cls.COMPAT_ENGINES))    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            
            col = layout.column()
    
            if obj.pov.object_as == 'CONE':
                if obj.pov.unlock_parameters == False:
                    col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED') 
                    col.label(text="Cone base radius: " + str(obj.pov.cone_base_radius))
                    col.label(text="Cone cap radius: " + str(obj.pov.cone_cap_radius))
                    col.label(text="Cone proxy segments: " + str(obj.pov.cone_segments))
                    col.label(text="Cone height: " + str(obj.pov.cone_height))
                else:
                    col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED') 
                    col.label(text="3D view proxy may get out of synch")
                    col.active = obj.pov.unlock_parameters
                    
    
                    layout.operator("pov.cone_update", text="Update",icon="MESH_CONE")        
                    
                    #col.label(text="Parameters:")
                    col.prop(obj.pov, "cone_base_radius", text="Radius of Cone Base")
                    col.prop(obj.pov, "cone_cap_radius", text="Radius of Cone Cap")
                    col.prop(obj.pov, "cone_segments", text="Segmentation of Cone proxy")
                    col.prop(obj.pov, "cone_height", text="Height of the cone")
    
    class OBJECT_PT_povray_obj_superellipsoid(PovDataButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray Superquadric ellipsoid"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        #bl_options = {'HIDE_HEADER'}
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            obj = context.object
            return (obj and obj.pov.object_as == 'SUPERELLIPSOID' and (engine in cls.COMPAT_ENGINES))    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            
            col = layout.column()
    
            if obj.pov.object_as == 'SUPERELLIPSOID':
                if obj.pov.unlock_parameters == False:
                    col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED') 
                    col.label(text="Radial segmentation: " + str(obj.pov.se_u))
                    col.label(text="Lateral segmentation: " + str(obj.pov.se_v))
                    col.label(text="Ring shape: " + str(obj.pov.se_n1))
                    col.label(text="Cross-section shape: " + str(obj.pov.se_n2))
                    col.label(text="Fill up and down: " + str(obj.pov.se_edit))
                else:
                    col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED') 
                    col.label(text="3D view proxy may get out of synch")
                    col.active = obj.pov.unlock_parameters
                    
    
                    layout.operator("pov.superellipsoid_update", text="Update",icon="MOD_SUBSURF")        
                    
                    #col.label(text="Parameters:")
                    col.prop(obj.pov, "se_u")
                    col.prop(obj.pov, "se_v")
                    col.prop(obj.pov, "se_n1")
                    col.prop(obj.pov, "se_n2")
                    col.prop(obj.pov, "se_edit")
                    
                    
    class OBJECT_PT_povray_obj_torus(PovDataButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray Torus"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        #bl_options = {'HIDE_HEADER'}
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            obj = context.object
            return (obj and obj.pov.object_as == 'TORUS' and (engine in cls.COMPAT_ENGINES))    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            
            col = layout.column()
    
            if obj.pov.object_as == 'TORUS':
                if obj.pov.unlock_parameters == False:
                    col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED') 
                    col.label(text="Torus major radius: " + str(obj.pov.torus_major_radius))
                    col.label(text="Torus minor radius: " + str(obj.pov.torus_minor_radius))
                    col.label(text="Torus major segments: " + str(obj.pov.torus_major_segments))
                    col.label(text="Torus minor segments: " + str(obj.pov.torus_minor_segments))
                else:
                    col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED') 
                    col.label(text="3D view proxy may get out of synch")
                    col.active = obj.pov.unlock_parameters
                    
    
                    layout.operator("pov.torus_update", text="Update",icon="MESH_TORUS")        
                    
                    #col.label(text="Parameters:")
                    col.prop(obj.pov, "torus_major_radius")
                    col.prop(obj.pov, "torus_minor_radius")
                    col.prop(obj.pov, "torus_major_segments")
                    col.prop(obj.pov, "torus_minor_segments")
    
    class OBJECT_PT_povray_obj_supertorus(PovDataButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray SuperTorus"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        #bl_options = {'HIDE_HEADER'}
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            obj = context.object
            return (obj and obj.pov.object_as == 'SUPERTORUS' and (engine in cls.COMPAT_ENGINES))    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            
            col = layout.column()
    
            if obj.pov.object_as == 'SUPERTORUS':
                if obj.pov.unlock_parameters == False:
                    col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED') 
                    col.label(text="SuperTorus major radius: " + str(obj.pov.st_major_radius))
                    col.label(text="SuperTorus minor radius: " + str(obj.pov.st_minor_radius))
                    col.label(text="SuperTorus major segments: " + str(obj.pov.st_u))
                    col.label(text="SuperTorus minor segments: " + str(obj.pov.st_v))
                    
                    col.label(text="SuperTorus Ring Manipulator: " + str(obj.pov.st_ring))
                    col.label(text="SuperTorus Cross Manipulator: " + str(obj.pov.st_cross))
                    col.label(text="SuperTorus Internal And External radii: " + str(obj.pov.st_ie))
                    
                    col.label(text="SuperTorus accuracy: " + str(ob.pov.st_accuracy))
                    col.label(text="SuperTorus max gradient: " + str(ob.pov.st_max_gradient))
                    
    
                else:
                    col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED') 
                    col.label(text="3D view proxy may get out of synch")
                    col.active = obj.pov.unlock_parameters
                    
    
                    layout.operator("pov.supertorus_update", text="Update",icon="MESH_TORUS")        
                    
                    #col.label(text="Parameters:")
                    col.prop(obj.pov, "st_major_radius")
                    col.prop(obj.pov, "st_minor_radius")
                    col.prop(obj.pov, "st_u")
                    col.prop(obj.pov, "st_v")
                    col.prop(obj.pov, "st_ring")
                    col.prop(obj.pov, "st_cross")
                    col.prop(obj.pov, "st_ie")
                    #col.prop(obj.pov, "st_edit") #?
                    col.prop(obj.pov, "st_accuracy")
                    col.prop(obj.pov, "st_max_gradient")
                    
    class OBJECT_PT_povray_obj_parametric(PovDataButtonsPanel, bpy.types.Panel):
        bl_label = "POV-Ray Parametric surface"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        #bl_options = {'HIDE_HEADER'}
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            obj = context.object
            return (obj and obj.pov.object_as == 'PARAMETRIC' and (engine in cls.COMPAT_ENGINES))    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            
            col = layout.column()
    
            if obj.pov.object_as == 'PARAMETRIC':
                if obj.pov.unlock_parameters == False:
                    col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED') 
                    col.label(text="Minimum U: " + str(obj.pov.u_min))
                    col.label(text="Minimum V: " + str(obj.pov.v_min))
                    col.label(text="Maximum U: " + str(obj.pov.u_max))
                    col.label(text="Minimum V: " + str(obj.pov.v_min))
                    col.label(text="X Function: " + str(obj.pov.x_eq))
                    col.label(text="Y Function: " + str(obj.pov.y_eq))
                    col.label(text="Z Function: " + str(obj.pov.x_eq))
    
                else:
                    col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED') 
                    col.label(text="3D view proxy may get out of synch")
                    col.active = obj.pov.unlock_parameters
                    
    
                    layout.operator("pov.parametric_update", text="Update",icon="SCRIPTPLUGINS")        
                    
                    col.prop(obj.pov, "u_min", text="Minimum U")
                    col.prop(obj.pov, "v_min", text="Minimum V")
                    col.prop(obj.pov, "u_max", text="Maximum U")
                    col.prop(obj.pov, "v_max", text="Minimum V")
                    col.prop(obj.pov, "x_eq", text="X Function")
                    col.prop(obj.pov, "y_eq", text="Y Function")
                    col.prop(obj.pov, "z_eq", text="Z Function")
    
                    
    
    class OBJECT_PT_povray_replacement_text(ObjectButtonsPanel, bpy.types.Panel):
        bl_label = "Custom POV Code"
    
    Thomas Dinges's avatar
    Thomas Dinges committed
            col = layout.column()
    
            col.prop(obj.pov, "replacement_text", text="")
    
    ###############################################################################
    # Add Povray Objects
    ###############################################################################
            
    
    class Povray_primitives_add_menu(bpy.types.Menu):
        """Define the menu with presets"""
        bl_idname = "Povray_primitives_add_menu"
        bl_label = "Povray"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
        
        @classmethod
        def poll(cls, context):
            engine = context.scene.render.engine
            return (engine == 'POVRAY_RENDER')    
            
        def draw(self,context):
            layout = self.layout
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.menu(BasicShapesMenu.bl_idname, text = "Primitives",icon="GROUP")
            layout.menu(ImportMenu.bl_idname, text = "Import",icon="IMPORT")
    
    class BasicShapesMenu(bpy.types.Menu):
        bl_idname = "Basic_shapes_calls"
        bl_label = "Basic_shapes"
        
        def draw(self,context):
            pov = bpy.types.Object.pov #context.object.pov ? 
            layout = self.layout
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("pov.addplane", text="Infinite Plane",icon = 'MESH_PLANE')
            layout.operator("pov.addbox", text="Box",icon = 'MESH_CUBE')
            layout.operator("pov.addsphere", text="Sphere",icon = 'SOLID')
            layout.operator("pov.addcylinder", text="Cylinder",icon="MESH_CYLINDER")
            layout.operator("pov.cone_add", text="Cone",icon="MESH_CONE")
            layout.operator("pov.addtorus", text="Torus",icon = 'MESH_TORUS')
            layout.separator()
            layout.operator("pov.addparametric", text="Parametric",icon = 'SCRIPTPLUGINS')
            layout.operator("pov.addrainbow", text="Rainbow",icon="COLOR")
            layout.operator("pov.addlathe", text="Lathe",icon = 'MOD_SCREW')
            layout.operator("pov.addprism", text="Prism",icon = 'MOD_SOLIDIFY')
            layout.operator("pov.addsuperellipsoid", text="Superquadric Ellipsoid",icon = 'MOD_SUBSURF')
            layout.operator("pov.addheightfield", text="Height Field",icon="RNDCURVE")
            layout.operator("pov.addspheresweep", text="Sphere Sweep",icon = 'FORCE_CURVE')
            layout.separator()
            layout.operator("pov.addblobsphere", text="Blob Sphere",icon = 'META_DATA')
            layout.separator()
            layout.label("Isosurfaces")
            layout.operator("pov.addisosurfacebox", text="Isosurface Box",icon="META_CUBE")
            layout.operator("pov.addisosurfacesphere", text="Isosurface Sphere",icon="META_BALL")
            layout.operator("pov.addsupertorus", text="Supertorus",icon="SURFACE_NTORUS")
            layout.separator()
            layout.label(text = "Macro based")
            layout.operator("pov.addpolygontocircle", text="Polygon To Circle Blending",icon="RETOPO")
            layout.operator("pov.addloft", text="Loft",icon="SURFACE_NSURFACE")
            
    class ImportMenu(bpy.types.Menu):
        bl_idname = "Importer_calls"
        bl_label = "Import"
    
        def draw(self,context):
            pov = bpy.types.Object.pov #context.object.pov ? 
            layout = self.layout
            layout.operator_context = 'INVOKE_REGION_WIN'
    
            layout.operator("import_scene.pov",icon="FORCE_LENNARDJONES")
    
    
    def menu_func_add(self, context):
        engine = context.scene.render.engine
        if engine == 'POVRAY_RENDER':
            self.layout.menu("Povray_primitives_add_menu", icon="PLUGIN") 
    
    def menu_func_import(self, context):
        engine = context.scene.render.engine
        if engine == 'POVRAY_RENDER':
    
            self.layout.operator("import_scene.pov",icon="FORCE_LENNARDJONES")
    
    ##############Nodes
    
    # def find_node_input(node, name):
        # for input in node.inputs:
            # if input.name == name:
                # return input
    
    # def panel_node_draw(layout, id_data, output_type, input_name):
        # if not id_data.use_nodes:
            # #layout.operator("pov.material_use_nodes", icon='SOUND')#'NODETREE')
            # #layout.operator("pov.use_shading_nodes", icon='NODETREE')
            # layout.operator("WM_OT_context_toggle", icon='NODETREE').data_path = \
                            # "material.pov.material_use_nodes"        
            # return False
    
        # ntree = id_data.node_tree
    
        # node = find_node(id_data, output_type)
        # if not node:
            # layout.label(text="No output node")
        # else:
            # input = find_node_input(node, input_name)
            # layout.template_node_view(ntree, node, input)
    
        # return True
    
    class Node_map_create_menu(bpy.types.Menu):
        """Create maps"""
        bl_idname = "Node_map_create_menu"
        bl_label = "Create map"
    
        def draw(self,context):
            layout = self.layout
            layout.operator("node.map_create")
    
    def menu_func_nodes(self, context):
        ob = context.object
        if hasattr(ob,'active_material'):
            mat=context.object.active_material
            if mat and context.space_data.tree_type == 'ObjectNodeTree':
                self.layout.prop(mat.pov,"material_use_nodes")
                self.layout.menu("Node_map_create_menu")
                self.layout.operator("wm.updatepreviewkey")
            if hasattr(mat,'active_texture') and context.scene.render.engine == 'POVRAY_RENDER':
                tex=mat.active_texture
                if tex and context.space_data.tree_type == 'TextureNodeTree':
                    self.layout.prop(tex.pov,"texture_use_nodes")
    
    
    
    ###############################################################################
    # Camera Povray Settings
    ############################################################################### 
    
    class CAMERA_PT_povray_cam_dof(CameraDataButtonsPanel, bpy.types.Panel):
    
        bl_label = "POV-Ray Depth Of Field"
        COMPAT_ENGINES = {'POVRAY_RENDER'}
    
        def draw_header(self, context):
            cam = context.camera
    
    
            self.layout.prop(cam.pov, "dof_enable", text="")
    
        def draw(self, context):
            layout = self.layout
    
            cam = context.camera
    
    
            split = layout.split()
    
            col = split.column()
    
            col.prop(cam.pov, "dof_samples_min")
            col.prop(cam.pov, "dof_variance")
    
            col = split.column()
    
            col.prop(cam.pov, "dof_samples_max")
            col.prop(cam.pov, "dof_confidence")
    
    
    
    class CAMERA_PT_povray_replacement_text(CameraDataButtonsPanel, bpy.types.Panel):
        bl_label = "Custom POV Code"
    
    Thomas Dinges's avatar
    Thomas Dinges committed
            col = layout.column()
    
            col.prop(cam.pov, "replacement_text", text="")
    
    
    
    class TEXT_PT_povray_custom_code(TextButtonsPanel, bpy.types.Panel):
    
        bl_label = "POV-Ray"
    
    Thomas Dinges's avatar
    Thomas Dinges committed
            text = context.space_data.text
    
                layout.prop(text.pov, "custom_code", text="Add as POV code")