Hello!
I have been trying for hours to find how to create a Interger operator and be able to get its value when clicking on another button.
This is my code right now:
import bpy
#from bpy.types import Panel
#----------------------------------------------------------------Exporting-------------------------------------------------------------------
class LifeRoad_PT_Panel():
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_label = "LifeRoad"
bl_category = "LifeRoad"
class SUB_PT_Exporting(LifeRoad_PT_Panel, bpy.types.Panel):
bl_label = "Render"
bl_idname = "SUB_PT_Exporting"
bl_option = {"DEFAULT_CLOSED"}
def draw(self, context):
layout = self.layout
scene = context.scene
row = layout.row()
row.label(text="Export folder:")
row = layout.row()
row.prop(context.scene, "export_folder", text="")
#Render Resolution
row = layout.row()
row.label(text="Export Resolution;")
row = layout.row()
row.prop(context.scene, "export_folder", text="")
# Render an Image Button Calling its specific class
row = layout.row()
row.operator("object.renderimage", text = 'Render Image', icon="MOD_SMOOTH")
#-----Button Render Image
class OBJECT_OT_renderimage(bpy.types.Operator):
"""Render image from the camera"""
bl_idname = "object.renderimage" #This is used for the row.operator butto
bl_label = "Invokes a Script"
#Execute this function when the button is clicked
def execute(self, context):
print(????????)
return {'FINISHED'}
#All the Panel Name that will be used in the loops of register and unregister
classes = (
SUB_PT_Exporting,
OBJECT_OT_createcamera,
OBJECT_OT_rendermodemesh,
OBJECT_OT_rendermodeflat,
OBJECT_OT_renderimage
)
def register():
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
if __name__ == "__main__":
register()
Does anyone know how to do this?
I tried looking at the Blender API but I have hard issue understanding it. I only know the base of programming.
Does Blender have a page like this?
MaxScrip Doucumentation Example
I ask because that would make it easier to create Custom Panels.
Thank you in advance for you help and have a nice day!