Start Blender 3D version 2.5 or higher.
At the top, choose File from the menu and then User Preferences … or press keys Ctrl+Alt+U.
See the picture below:
Click the button Install Add-on …
A dialog will appear and you can select the script with that addon.
In this case his named free-tutorials2.org.
The script will be found in the User Preferences window on Camera Add-Ons section.
See image:
Let’s talk now about the script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | # # Test GUI for Blender 2.5 # # Script version 0.0.1 # # Copyright (c) 2010 www.free-tutorials.org # author Catalin Festila 2010 # # Load the script in the text editor and press Alt + P # Next go on: # Blender Menue->File->User Preferences->Install Add-On-> # Enable the Add-On by # clicking the checkbox and if you want 'Save As Default' # now you can select the camera in the 3DView and find # the 'Set new Camera' in the Properties->Camera Panel # # Update: Sept/13/2010 # # tested with: # Blender 2.5 beta (2.54.0) r31878 # import bpy import math # GUI Panel on Addon bl_addon_info = { 'name': 'Name of the addon', 'author': 'The author name and email adress', 'version': (0, 0, 0), 'blender': (2, 54, 0), 'api': 31878, 'location': 'Where it is on Blender GUI ', 'description': 'Description of addon', 'warning': '', 'wiki_url': 'http://www.free-tutorials.org', 'tracker_url': '', 'category': 'Camera'} class OBJECT_PT_new_camera(bpy.types.Panel): bl_label = "SETARI NOI Camera" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "data" # show this add-on only in the Camera-Data-Panel @classmethod def poll(self, context): return context.active_object.type == 'CAMERA' # # Add some custom new properties to the camera # bpy.types.Object.new_camera_separation = bpy.props.FloatProperty(attr="new_camera_separation", name='new_camera_separation', description='Camera Separation', min=0.0, soft_min=0.0, max=1000, soft_max=1000, default=200) # draw the gui def draw(self, context): layout = self.layout # get the custom new camera properties camera = context.scene.camera # cam separation input row = layout.row() row.prop(camera, "new_camera_separation", text="Camera Separation") # 'Set new Camera' button row = layout.row() row.operator('set_new_camera') # # Operator 'Set new Camera' # class OBJECT_OT_set_new_camera(bpy.types.Operator): bl_label = 'Set new Camera' bl_idname = 'set_new_camera' bl_description = 'Setup for the new Camera' def invoke(self, context, event): return {'FINISHED'} # # Register the Panel (GUI) and the Operator ('Set new Camera' Button) # def register(): pass #bpy.types.register(OBJECT_PT_new_camera) #bpy.types.register(OBJECT_OT_set_new_camera) def unregister(): pass #bpy.types.register(OBJECT_PT_new_camera) #bpy.types.register(OBJECT_OT_set_new_camera) if __name__ == "__main__": register() |
The source code does not have too many issues that can not be understood.
It is divided into three main parts: the first addon declaration, the second is to declare the two classes and a third room for registration.
The source code is not complete. It is made only for illustration.
It is good to read and on this wiki
The GUI result is shown in the next image.
I will return with a more complex tutorial on this topic.