Skip to content
Snippets Groups Projects
primitives.py 75.4 KiB
Newer Older
  • Learn to ignore specific revisions
  •                         # except UnboundLocalError:
                                # # In case no transmit is specified ? put it to 0
                                # r,g,b,t = float(S[2]),float(S[3]),float(S[4],0)
                                # color = (r,g,b,t)
    
                            # except (ValueError):
                                # color = (0.8,0.8,0.8,0)
                                # pass
    
                            # if colors == [] or (colors != [] and color not in colors):
                                # colors.append(color)
                                # name = ob.name+"_mat"
                                # matNames.append(name)
                                # mat = bpy.data.materials.new(name)
                                # mat.diffuse_color = (r,g,b)
                                # mat.alpha = 1-t
                                # if mat.alpha != 1:
                                    # mat.use_transparency=True
                                # ob.data.materials.append(mat)
                                # print (colors)
                            # else:
                                # for i in range(len(colors)):
                                    # if color == colors[i]:
    
                                        # ob.data.materials.append(bpy.data.materials[matNames[i]])
    
            ##To keep Avogadro Camera angle:
    
            # for obj in bpy.context.view_layer.objects:
    
                # if obj.type == "CAMERA":
                    # track = obj.constraints.new(type = "TRACK_TO")
                    # track.target = ob
                    # track.track_axis ="TRACK_NEGATIVE_Z"
                    # track.up_axis = "UP_Y"
    
                    # obj.location = (0,0,0)
            return {'FINISHED'}
    
    
    classes = (
        POVRAY_OT_lathe_add,
        POVRAY_OT_superellipsoid_add,
        POVRAY_OT_superellipsoid_update,
        POVRAY_OT_supertorus_add,
        POVRAY_OT_supertorus_update,
        POVRAY_OT_loft_add,
        POVRAY_OT_plane_add,
        POVRAY_OT_box_add,
        POVRAY_OT_cylinder_add,
        POVRAY_OT_cylinder_update,
        POVRAY_OT_sphere_add,
        POVRAY_OT_sphere_update,
        POVRAY_OT_cone_add,
        POVRAY_OT_cone_update,
        POVRAY_OT_isosurface_box_add,
        POVRAY_OT_isosurface_sphere_add,
        POVRAY_OT_sphere_sweep_add,
        POVRAY_OT_blob_add,
        POVRAY_OT_rainbow_add,
        POVRAY_OT_height_field_add,
        POVRAY_OT_torus_add,
        POVRAY_OT_torus_update,
        POVRAY_OT_prism_add,
        POVRAY_OT_parametric_add,
        POVRAY_OT_parametric_update,
        POVRAY_OT_shape_polygon_to_circle_add,
        ImportPOV,
    )
    
    
    def register():
        #from bpy.utils import register_class
    
        for cls in classes:
            register_class(cls)
    
    
    def unregister():
        from bpy.utils import unregister_class
    
        for cls in classes:
            unregister_class(cls)