예제 #1
0
class OAGroup(PropertyGroup):
    oa_type = EnumProperty(items=[("NONE", "None", "None", "", 0),
                                  ("SIMP", "Simple", "Simple", "", 1),
                                  ("BASE", "Base", "Base", "", 2),
                                  ("IMPL", "Implementation", "Implementation",
                                   "", 3)],
                           default="NONE",
                           name="Type")

    oa_id = IntVectorProperty(name="Id", default=(0, 0, 0), size=3,
                              min=0)  # (series, category, model)
    base_id = IntVectorProperty(name="Base Id",
                                default=(0, 0, 0),
                                size=3,
                                min=0)

    upside = FloatVectorProperty(default=(0, 0, 0))
    downside = FloatVectorProperty(default=(0, 0, 0))
    outside = FloatVectorProperty(default=(0, 0, 0))
    inside = FloatVectorProperty(default=(0, 0, 0))

    upside_set = BoolProperty(default=False)
    downside_set = BoolProperty(default=False)
    outside_set = BoolProperty(default=False)
    inside_set = BoolProperty(default=False)

    valid_horizontal = BoolProperty(default=False)
    valid_vertical = BoolProperty(default=False)

    tags = CollectionProperty(type=OAModelTag)
    default = BoolProperty(default=False)
예제 #2
0
class PathPropertyGroup(PropertyGroup):
    force_outside: BoolProperty(
        name="Force Outside Path",
        update=generate_maze,
        default=True,
    )
    solution: EnumProperty(
        name="Solution",
        default="Longest",
        items=(
            ("Longest", ) * 3,
            ("Random", ) * 3,
            ("Custom", ) * 3,
        ),
        update=generate_maze,
    )
    start: IntVectorProperty(
        size=2,
        min=0,
        update=generate_maze,
        subtype='XYZ',
    )
    end: IntVectorProperty(
        size=2,
        min=0,
        update=generate_maze,
        subtype='XYZ',
    )
예제 #3
0
class TextureReducerProps(bpy.types.PropertyGroup):
    columns_rows = IntVectorProperty(name = "Cols,Rows", description = "Grid : Columns & Rows", default = (3, 3), min = 1, max = 1000, size = 2)
    cell_xy = IntVectorProperty(name = "Cell XY", description = "Grid : position of the cell", default = (1, 1), min = 1, max = 1000, size = 2)
    image_wh = IntVectorProperty(name = "Image WH", description = "XY : width and height of merged image", default = (1024, 1024), min = 0, max = 999999, size = 2)
    target_xy = IntVectorProperty(name = "Target XY", description = "XY : upper left position of target portion", default = (100, 100), min = 0, max = 999999, size = 2)
    target_wh = IntVectorProperty(name = "Target WH", description = "XY : width and height of target portion", default = (300, 200), min = 0, max = 999999, size = 2)
    method = EnumProperty(items = [('GRID', 'GRID', 'Grid version'), 
                                    ('XY', 'XY', 'XY version')],
                                         name="Method",
                                         description="Way of execution",
                                         default="GRID")
예제 #4
0
파일: window.py 프로젝트: wobakj/avango
class Window(Node, node_tree.AvangoCustomTreeNode):
    bl_idname = 'Window'
    bl_label = 'Window'

    display_field = StringProperty(
        description='display number',
        default=':0.0',
    )

    title_field = StringProperty(description='window title',
                                 default='beautiful')

    left_size = IntVectorProperty(
        name="Resolution",
        description="size",
        default=(1024, 768),
        min=1,
        size=2,
    )

    left_pos = IntVectorProperty(
        name="Position",
        description="size",
        default=(0, 0),
        min=0,
        size=2,
    )

    enabled = BoolProperty(
        name="enabled",
        description="enabled",
        default=True,
    )

    def init(self, context):
        self.inputs.new('StereoModeSocketType', "StereoMode")
        self.outputs.new('WindowSocketType', 'Window')

    def draw_buttons(self, context, layout):
        col = layout.column()
        col.prop(self, 'name', text='Name')
        col.prop(self, 'title_field', text='Title')
        col.prop(self, 'display_field', text='Display')
        col.prop(self, 'left_size', text='LeftSize')
        col.prop(self, 'left_pos', text='LeftPosition')

    def process(self):
        pass

    def get_args(self):
        pass
예제 #5
0
class StoredViewsData(PropertyGroup):
    pov_list: CollectionProperty(
            type=POVData
            )
    layers_list: CollectionProperty(
            type=LayersData
            )
    display_list: CollectionProperty(
            type=DisplayData
            )
    view_list: CollectionProperty(
            type=ViewData
            )
    mode: EnumProperty(
            name="Mode",
            items=[('VIEW', "View", "3D View settings"),
                   ('POV', "POV", "POV settings"),
                   ('LAYERS', "Layers", "Layers settings"),
                   ('DISPLAY', "Display", "Display settings")],
            default='VIEW'
            )
    current_indices = IntVectorProperty(
            size=4,
            default=[-1, -1, -1, -1]
            )
    view_modified: BoolProperty(
            default=False
            )
예제 #6
0
class OctaneImageTiles(bpy.types.Node, OctaneBaseNode):
    bl_idname="OctaneImageTiles"
    bl_label="Image tiles"
    bl_width_default=200
    octane_render_pass_id=-1
    octane_render_pass_name=""
    octane_render_pass_short_name=""
    octane_render_pass_description=""
    octane_render_pass_sub_type_name=""
    octane_min_version=0
    octane_node_type: IntProperty(name="Octane Node Type", default=131)
    octane_socket_list: StringProperty(name="Socket List", default="Power;Color space;Legacy gamma;Invert;Linear sRGB invert;UV transform;Projection;Empty tile color;")
    octane_attribute_list: StringProperty(name="Attribute List", default="a_image_color_format;a_grid_size;a_reload;a_channel_format;a_image_chosen_layer_name;a_ies_photometry_mode;")
    octane_attribute_config_list: StringProperty(name="Attribute Config List", default="2;3;1;2;10;2;")
    octane_static_pin_count: IntProperty(name="Octane Static Pin Count", default=8)

    a_image_color_format: IntProperty(name="Image color format", default=0, update=None, description="Control in which color format the textures are loaded, see Octane::ImageColorType. If set to IMAGE_COLOR_KEEP_SOURCE images are loaded either as RGB color or greyscale, depending on the format used to save the image file")
    a_grid_size: IntVectorProperty(name="Grid size", default=(1, 1), size=2, update=None, description="The size of the image tile grid")
    a_reload: BoolProperty(name="Reload", default=False, update=None, description="TRUE if the files needs a reload. After evaluation the attribute will be false again")
    a_channel_format: IntProperty(name="Channel format", default=2, update=None, description="Indicate the preferred channel format for loading this image. This is ignored for 8-bit images. For other images, use IMAGE_CHANNEL_HALF and IMAGE_CHANNEL_FLOAT to always load images in that format, use IMAGE_CHANNEL_AUTO to infer the format from the source data")
    a_image_chosen_layer_name: StringProperty(name="Image chosen layer name", default="", update=None, description="Indicate the chosen layer name, if the current image has multiple layers")
    a_ies_photometry_mode: IntProperty(name="Ies photometry mode", default=1, update=None, description="How to normalize data from IES files. (see Octane::IesPhotometryMode)")

    def init(self, context):
        self.inputs.new("OctaneImageTilesPower", OctaneImageTilesPower.bl_label).init()
        self.inputs.new("OctaneImageTilesColorSpace", OctaneImageTilesColorSpace.bl_label).init()
        self.inputs.new("OctaneImageTilesGamma", OctaneImageTilesGamma.bl_label).init()
        self.inputs.new("OctaneImageTilesInvert", OctaneImageTilesInvert.bl_label).init()
        self.inputs.new("OctaneImageTilesLinearSpaceInvert", OctaneImageTilesLinearSpaceInvert.bl_label).init()
        self.inputs.new("OctaneImageTilesTransform", OctaneImageTilesTransform.bl_label).init()
        self.inputs.new("OctaneImageTilesProjection", OctaneImageTilesProjection.bl_label).init()
        self.inputs.new("OctaneImageTilesEmptyTileColor", OctaneImageTilesEmptyTileColor.bl_label).init()
        self.outputs.new("OctaneTextureOutSocket", "Texture out").init()
예제 #7
0
class OctaneChaosTextureResolution(OctaneBaseSocket):
    bl_idname = "OctaneChaosTextureResolution"
    bl_label = "Resolution"
    color = consts.OctanePinColor.Int
    octane_default_node_type = "OctaneIntValue"
    octane_pin_id: IntProperty(name="Octane Pin ID", default=198)
    octane_pin_type: IntProperty(name="Octane Pin Type",
                                 default=consts.PinType.PT_INT)
    octane_socket_type: IntProperty(name="Socket Type",
                                    default=consts.SocketType.ST_INT2)
    default_value: IntVectorProperty(
        default=(4096, 4096),
        update=None,
        description=
        "Resolution used to sample the input texture.\nThis is only used if the source texture is not an image or if histogram invariant blending is enabled",
        min=4,
        max=65536,
        soft_min=4,
        soft_max=65536,
        step=1,
        subtype="NONE",
        size=2)
    octane_hide_value = False
    octane_min_version = 10020600
    octane_end_version = 4294967295
    octane_deprecated = False
예제 #8
0
class COATOOLS_OT_CreateOrtpographicCamera(bpy.types.Operator):
    bl_idname = "coa_tools.create_ortho_cam"
    bl_label = "Camera Settings"
    bl_options = {"REGISTER", "UNDO"}

    set_resolution: BoolProperty(name="Set Resolution", default=True)
    resolution: IntVectorProperty(name="Resolution",
                                  default=(960, 600),
                                  size=2)
    create: BoolProperty(name="Create Camera", default=True)

    def draw(self, context):
        layout = self.layout
        if self.create:
            row = layout.row()
            row.prop(self, "set_resolution")

        row = layout.row()
        row.prop(self, "resolution")

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self)

    def execute(self, context):
        sprite_object = None
        if context.active_object != None:
            sprite_object = get_sprite_object(context.active_object)

        scene = context.scene
        if self.create:
            context.view_layer.objects.active = None
            bpy.ops.object.camera_add(
                enter_editmode=False,
                align='WORLD',
                location=(0, -self.resolution[0] *
                          get_addon_prefs(context).sprite_import_export_scale,
                          0),
                rotation=(radians(90), 0, 0))
        cam = context.active_object
        context.view_layer.objects.active = cam
        cam.data.type = "ORTHO"
        scene.render.film_transparent = True

        if sprite_object != None:
            cam.parent = sprite_object

        if self.set_resolution:
            ortho_scale = max(self.resolution[0], self.resolution[1])
            cam.data.ortho_scale = ortho_scale / 100

            scene.render.resolution_x = self.resolution[0]
            scene.render.resolution_y = self.resolution[1]
            cam.location[1] = -self.resolution[0] * get_addon_prefs(
                context).sprite_import_export_scale
            scene.render.resolution_percentage = 100
        scene.camera = cam
        if bpy.context.space_data.region_3d.view_perspective != "CAMERA":
            bpy.ops.view3d.view_camera()
        return {"FINISHED"}
예제 #9
0
class RevoltObjectProperties(bpy.types.PropertyGroup):
    rv_type = EnumProperty(
        name="Type",
        items=(
            ("NONE", "None", "None"),
            ("MESH", "Mesh (.prm)", "Mesh"),
            #("OBJECT", "Object (.fob)", "Object"),
            #("INSTANCE", "Instance (.fin)", "Instance"),
            ("WORLD", "World (.w)", "World"),
            ("NCP", "Collision (.ncp)", "Collision (NCP)"),
            #("HULL", "Hull (.hul)", "Hull"),
        ))
    # this is for setting the object type (mesh, w, ncp, fin, ...)
    object_type = EnumProperty(name="Object type", items=const.object_types)
    # this is the flags layer for meshes
    flags = IntVectorProperty(name="Flags", size=16)
    texture = IntProperty(
        name="Texture"
    )  # deprecated, could be removed since textures are saved per-face now
    # this is for fin and fob file entries: each object can have unique settings.
    # fin files have predefined settings
    flag1_long = IntProperty(get=lambda s: helpers.get_flag_long(s, 0),
                             set=lambda s, v: helpers.set_flag_long(s, v, 0))
    flag2_long = IntProperty(get=lambda s: helpers.get_flag_long(s, 4),
                             set=lambda s, v: helpers.set_flag_long(s, v, 4))
    flag3_long = IntProperty(get=lambda s: helpers.get_flag_long(s, 8),
                             set=lambda s, v: helpers.set_flag_long(s, v, 8))
    flag4_long = IntProperty(get=lambda s: helpers.get_flag_long(s, 12),
                             set=lambda s, v: helpers.set_flag_long(s, v, 12))
    # these flags can be set for objects other than the mentioned type (export .w to ncp, export prm as part of .w)
    export_as_ncp = BoolProperty(name="Additionally export as NCP (.ncp)")
    export_as_w = BoolProperty(name="Additionally export as World (.w)")
    use_tex_num = BoolProperty(name="Keep texture number from mesh.")
예제 #10
0
class OctaneFilmSettingsResolution(OctaneBaseSocket):
    bl_idname = "OctaneFilmSettingsResolution"
    bl_label = "Resolution"
    color = consts.OctanePinColor.Int
    octane_default_node_type = "OctaneImageResolution"
    octane_pin_id: IntProperty(name="Octane Pin ID", default=198)
    octane_pin_type: IntProperty(name="Octane Pin Type",
                                 default=consts.PinType.PT_INT)
    octane_socket_type: IntProperty(name="Socket Type",
                                    default=consts.SocketType.ST_INT2)
    default_value: IntVectorProperty(
        default=(1024, 512),
        update=None,
        description="Resolution of the render result",
        min=4,
        max=65536,
        soft_min=4,
        soft_max=65536,
        step=1,
        subtype="NONE",
        size=2)
    octane_hide_value = False
    octane_min_version = 0
    octane_end_version = 4294967295
    octane_deprecated = False
예제 #11
0
class WBoxData(bpy.types.PropertyGroup):
    size = FloatVectorProperty (
        name="Size",
        description="Size of the WBox",
        default=(2.0, 2.0, 2.0),
        min=0.0,
        soft_min=0.0,
        step=1,
        precision=2,
        subtype='XYZ',
        unit='LENGTH',
        size=3,
        update = UpdateWBox
    )

    segments = IntVectorProperty (
        name="Segments",
        description="Segmentation of the WBox",
        default=(1, 1, 1),
        min=1,
        soft_min=1,
        step=1,
        subtype='XYZ',
        size=3,
        update = UpdateWBox
    )

    centered = BoolProperty (
        name="Centered",
        description="Where is origin of the WBox",
        default=True,
        update = UpdateWBox
    )
예제 #12
0
class CWH_Preferences(bpy.types.AddonPreferences):

    bl_idname = __name__

    font_size = IntProperty(
        name="Font Size",
        description="フォントサイズ",
        default=15,
        max=50,
        min=10
    )
    left_top = IntVectorProperty(
        name="左上座標",
        description="情報を表示する左上の座標",
        size=2,
        subtype='XYZ',
        default=(20, 60),
        max=300,
        min=0
    )

    def draw(self, context):
        layout = self.layout

        layout.label("UI: ")
        sp = layout.split(percentage=0.3)
        col = sp.column()
        col.prop(self, "left_top")
        col.prop(self, "font_size")
예제 #13
0
class OctaneFilmSettingsRegionSize(OctaneBaseSocket):
    bl_idname = "OctaneFilmSettingsRegionSize"
    bl_label = "Region size"
    color = consts.OctanePinColor.Int
    octane_default_node_type = "OctaneIntValue"
    octane_pin_id: IntProperty(name="Octane Pin ID", default=313)
    octane_pin_type: IntProperty(name="Octane Pin Type",
                                 default=consts.PinType.PT_INT)
    octane_socket_type: IntProperty(name="Socket Type",
                                    default=consts.SocketType.ST_INT2)
    default_value: IntVectorProperty(
        default=(65536, 65536),
        update=None,
        description="The size of the render region",
        min=1,
        max=65536,
        soft_min=1,
        soft_max=65536,
        step=1,
        subtype="NONE",
        size=2)
    octane_hide_value = False
    octane_min_version = 0
    octane_end_version = 4294967295
    octane_deprecated = False
예제 #14
0
def load_int_vector_attr(name, props):
    int_vec_property = IntVectorProperty(name=props.get('name', ''),
                                         description=props.get('description',
                                                               ''),
                                         default=tuple(props.get('default',
                                                                [0, 0, 0])),
                                         subtype=props.get('subtype', 'NONE'))
    setattr(bpy.types.Scene, name, int_vec_property)
예제 #15
0
class SelectionOperator(bpy.types.Operator):
    """ Custom selection """
    bl_idname = "view3d.select_custom"
    bl_label = "Custom selection"
    bl_options = {"UNDO", "UNDO_GROUPED"}

    extend: BoolProperty(default=False)
    deselect: BoolProperty(default=False)
    toggle: BoolProperty(default=False)
    center: BoolProperty(default=False)
    enumerate: BoolProperty(default=False)
    object: BoolProperty(default=False)
    location: IntVectorProperty(default=(0, 0), subtype='XYZ', size=2)

    @classmethod
    def poll(cls, context):
        return context.area.type == 'VIEW_3D' and context.mode == 'OBJECT'

    def execute(self, context):
        #deactivate=False
        #if context.active_object:
        #    obname = context.active_object.name
        #    deactivate = obname.startswith('BLS_CONTROLLER.') or obname.startswith('BLS_LIGHT_MESH.')

        #result = bpy.ops.view3d.select(extend=self.extend, deselect=self.deselect, toggle=self.toggle, center=self.center, enumerate=self.enumerate, object=self.object)
        result = bpy.ops.view3d.select(extend=self.extend,
                                       deselect=self.deselect,
                                       toggle=self.toggle,
                                       center=self.center,
                                       enumerate=self.enumerate,
                                       object=self.object,
                                       location=(self.location[0],
                                                 self.location[1]))
        if 'FINISHED' not in result:
            return {'PASS_THROUGH'}
        if context.active_object:
            obname = context.active_object.name
            if obname.startswith('BLS_CONTROLLER.'):
                lm = getLightMesh()
                if lm:
                    lm.select = True

            #if deactivate or obname.startswith('BLS_CONTROLLER.') or obname.startswith('BLS_LIGHT_MESH.'):
            #    refreshMaterials()

            context.scene.frame_current = context.scene.frame_current
            refreshMaterials()

        if context.user_preferences.inputs.select_mouse == 'RIGHT':
            return {'FINISHED'}
        elif self.toggle:
            return {'FINISHED'}
        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        self.location[0] = event.mouse_region_x
        self.location[1] = event.mouse_region_y
        return self.execute(context)
예제 #16
0
 def init_props(cls, scene):
     scene.muv_world_scale_uv_enabled = BoolProperty(
         name="World Scale UV Enabled",
         description="World Scale UV is enabled",
         default=False)
     scene.muv_world_scale_uv_src_mesh_area = FloatProperty(
         name="Mesh Area",
         description="Source Mesh Area",
         default=0.0,
         min=0.0)
     scene.muv_world_scale_uv_src_uv_area = FloatProperty(
         name="UV Area", description="Source UV Area", default=0.0, min=0.0)
     scene.muv_world_scale_uv_src_density = FloatProperty(
         name="Density",
         description="Source Texel Density",
         default=0.0,
         min=0.0)
     scene.muv_world_scale_uv_tgt_density = FloatProperty(
         name="Density",
         description="Target Texel Density",
         default=0.0,
         min=0.0)
     scene.muv_world_scale_uv_tgt_scaling_factor = FloatProperty(
         name="Scaling Factor", default=1.0, max=1000.0, min=0.00001)
     scene.muv_world_scale_uv_tgt_texture_size = IntVectorProperty(
         name="Texture Size",
         size=2,
         min=1,
         soft_max=10240,
         default=(1024, 1024),
     )
     scene.muv_world_scale_uv_mode = EnumProperty(
         name="Mode",
         description="Density calculation mode",
         items=[
             ('PROPORTIONAL_TO_MESH', "Proportional to Mesh",
              "Apply density proportionaled by mesh size"),
             ('SCALING_DENSITY', "Scaling Density",
              "Apply scaled density from source"),
             ('SAME_DENSITY', "Same Density",
              "Apply same density of source"),
             ('MANUAL', "Manual", "Specify density and size by manual"),
         ],
         default='MANUAL')
     scene.muv_world_scale_uv_origin = EnumProperty(
         name="Origin",
         description="Aspect Origin",
         items=[('CENTER', "Center", "Center"),
                ('LEFT_TOP', "Left Top", "Left Bottom"),
                ('LEFT_CENTER', "Left Center", "Left Center"),
                ('LEFT_BOTTOM', "Left Bottom", "Left Bottom"),
                ('CENTER_TOP', "Center Top", "Center Top"),
                ('CENTER_BOTTOM', "Center Bottom", "Center Bottom"),
                ('RIGHT_TOP', "Right Top", "Right Top"),
                ('RIGHT_CENTER', "Right Center", "Right Center"),
                ('RIGHT_BOTTOM', "Right Bottom", "Right Bottom")],
         default='CENTER')
예제 #17
0
def reg_screen_action_bgl():
    def index(self):
        sp = self.name.split("_")
        return int(sp[-1])

    def area(self):
        return self.id_data.areas[self.area_index]

    prop_dic = {
        "loc":
        IntVectorProperty(size=2, default=(0, 24), min=0),
        "color":
        FloatVectorProperty(subtype='COLOR_GAMMA', size=4),
        "height":
        IntProperty(default=20,
                    min=10,
                    max=100,
                    step=1,
                    subtype='PERCENTAGE',
                    description="Height (Percent of View)",
                    update=update_graph),
        "use_fcurve_colors":
        BoolProperty(default=True),
        "is_enabled":
        BoolProperty(default=True,
                     description="Enable SoundVis for this Area"),
    }

    action_bgl_props = type("ActionBGL", (PropertyGroup, ), prop_dic)
    register_class(action_bgl_props)
    #sa = SupportedAreas()

    propdic = {
        "area_index": property(index),
        "area": property(area),
        "area_type": StringProperty(default='VIEW3D'),  # change to ENUM
        "action_name": StringProperty(default=""),
        "use_active_action": BoolProperty(default=True),
        "channel_name": StringProperty(),
        "action": property(get_action, set_action),
        "VIEW_3D": PointerProperty(type=action_bgl_props),
        "GRAPH_EDITOR": PointerProperty(type=action_bgl_props),
        "NLA_EDITOR": PointerProperty(type=action_bgl_props),
        "SEQUENCE_EDITOR": PointerProperty(type=action_bgl_props),
        #"CONSOLE": PointerProperty(type=action_bgl_props), # for testing UI
        "TIMELINE": PointerProperty(type=action_bgl_props),
    }

    def get_sda_current(self):
        return ScreenAreaAction(self)

    SD_AreaSettings = type("SD_AreaSettings", (bpy.types.PropertyGroup, ),
                           propdic)
    bpy.utils.register_class(SD_AreaSettings)
    bpy.types.Screen.sound_driver_areas = CollectionProperty(
        type=SD_AreaSettings)
    bpy.types.Context.sound_vis_areas = property(get_sda_current)
예제 #18
0
class MUV_OT_WorldScaleUV_ApplyManual(bpy.types.Operator):
    """
    Operation class: Apply scaled UV (Manual)
    """

    bl_idname = "uv.muv_world_scale_uv_operator_apply_manual"
    bl_label = "Apply World Scale UV (Manual)"
    bl_description = "Apply scaled UV based on user specification"
    bl_options = {'REGISTER', 'UNDO'}

    tgt_density = FloatProperty(name="Density",
                                description="Target Texel Density",
                                default=1.0,
                                min=0.0)
    tgt_texture_size = IntVectorProperty(
        name="Texture Size",
        size=2,
        min=1,
        soft_max=10240,
        default=(1024, 1024),
    )
    origin = EnumProperty(name="Origin",
                          description="Aspect Origin",
                          items=[
                              ('CENTER', "Center", "Center"),
                              ('LEFT_TOP', "Left Top", "Left Bottom"),
                              ('LEFT_CENTER', "Left Center", "Left Center"),
                              ('LEFT_BOTTOM', "Left Bottom", "Left Bottom"),
                              ('CENTER_TOP', "Center Top", "Center Top"),
                              ('CENTER_BOTTOM', "Center Bottom",
                               "Center Bottom"),
                              ('RIGHT_TOP', "Right Top", "Right Top"),
                              ('RIGHT_CENTER', "Right Center", "Right Center"),
                              ('RIGHT_BOTTOM', "Right Bottom", "Right Bottom")
                          ],
                          default='CENTER')
    show_dialog = BoolProperty(name="Show Diaglog Menu",
                               description="Show dialog menu if true",
                               default=True,
                               options={'HIDDEN', 'SKIP_SAVE'})

    def __init__(self):
        self.__impl = impl.ApplyManualImpl()

    @classmethod
    def poll(cls, context):
        return impl.ApplyManualImpl.poll(context)

    def draw(self, context):
        self.__impl.draw(self, context)

    def invoke(self, context, event):
        return self.__impl.invoke(self, context, event)

    def execute(self, context):
        return self.__impl.execute(self, context)
예제 #19
0
class OACollectVariation(PropertyGroup):
    group_name = StringProperty(default="")
    tags = CollectionProperty(type=OACollectTag)
    oa_type = EnumProperty(items=[
            ("SIMP", "Simple", "Simple", "", 0),
            ("IMPL", "Implementation", "Implementation", "", 1)],
                           default="SIMP", name="Type")
    base_id = IntVectorProperty(default=(0,0,0), size=3, min=0)
    default = BoolProperty(default=False)
    sp_obj = StringProperty(default="")
예제 #20
0
class NMSMaterialProperties(bpy.types.PropertyGroup):
    material_additions: IntVectorProperty(
        name="Force material properties",
        description="List of flags to be added (use int prefix). Ie. "
        "'_F14_UVSCROLL' == 14",
        min=0,
        max=64,
        soft_min=0,
        soft_max=64,
        size=5)
class JK_MMT_Retarget_Item(bpy.types.PropertyGroup):

    Show_children: BoolProperty(name="Expand",
                                description="Show the children of this bone",
                                default=False)

    Indices: IntVectorProperty(
        name="Indices",
        description="Indices to map to the bones name",
        default=(-1, -1, -1),
        size=3,
    )

    Parent: StringProperty(
        name="Parent",
        description="Parent of this bone",
        default="",
        maxlen=1024,
    )

    Retarget: EnumProperty(
        name="Retargeting Translation",
        description="Set bone translation retargeting",
        items=[('SKELETON', 'Skeleton', "Use translation from skeleton"),
               ('ANIMATION', 'Animation', "Use translation from animation")],
        #('ANIMATION_SCALED', 'Animation Scaled', "Biped based rig"),
        #('ANIMATION_RELATIVE', 'Animation Relative', "Weapon based rig"),
        #('ORIENT_SCALE', 'Orient and Scale', "User created rig")],
        default='ANIMATION',
    )

    Type: EnumProperty(
        name="Retarget Type",
        description="Set the retarget type. (only used while retargeting)",
        items=
        [('NONE', 'Manual', "Manually assign rotation"),
         ('STRETCH', 'Stretch', "Stretches to target"),
         ('TWIST_HOLD', 'Twist Hold',
          "Holds back the Y rotation. (eg: Upper Arm Twist)"),
         ('TWIST_FOLLOW', 'Twist Follow',
          "Follows targets Y rotation. (eg: Lower Arm Twist)"),
         ('ROOT_COPY', 'Root Copy',
          "Copies world space rotation of it's parent"),
         ('IK_DEFAULT', 'IK Default',
          "An IK deform bone present in the default rig. (You will need to remove/set this bone up yourself)"
          )],
        default='NONE',
    )

    Subtarget: StringProperty(
        name="Subtarget",
        description="Subtarget during retargeting (if any)",
        default="",
        maxlen=1024,
    )
class CP_OT_create_cube(Operator):
    """Creates a new Changable Cube"""
    bl_idname = "object.cp_ot_create_cube"
    bl_label = "Create Changable Cube"
    bl_options = {'REGISTER', 'UNDO'}

    # Properties
    subdivisions: IntVectorProperty(name="Subdivisions",
                                    size=3,
                                    default=(2, 2, 2),
                                    min=2)

    size: FloatProperty(name="Size", default=1.0, unit='LENGTH')

    align_rot_to_cursor: BoolProperty(name="Align Rotation to 3D Cursor",
                                      default=False)

    @classmethod
    def poll(cls, context):
        return context.mode == "OBJECT"

    def execute(self, context):
        # Deselect all objects
        for obj in context.selected_objects:
            obj.select_set(False)

        # Create mesh and object
        obj = create_and_link_mesh_object(context, "ChangableCube")
        obj.location = context.scene.cursor.location.copy()
        if self.align_rot_to_cursor:
            obj.rotation_euler = context.scene.cursor.rotation_euler.copy()

        # Change draw options
        obj.show_wire = True
        obj.show_all_edges = True

        # Set created object as active
        obj.select_set(True)
        context.view_layer.objects.active = obj

        # Initialize Changable Primitive Settings
        settings = obj.data.changable_primitive_settings
        settings.enabled = True
        settings.type = "CUBE"
        settings.x_subdivisions = self.subdivisions[0]
        settings.y_subdivisions = self.subdivisions[1]
        settings.z_subdivisions = self.subdivisions[2]
        settings.height = self.size

        # Create mesh
        bpy.ops.object.cp_ot_update_cube()

        return {'FINISHED'}
예제 #23
0
class OASettings(bpy.types.PropertyGroup):
    oa_file = StringProperty(name = "", default = "", subtype = 'FILE_PATH')
    loaded_oa_file = StringProperty(name = "", default = "", subtype = 'FILE_PATH')
    oa_mode_started = BoolProperty(default=False)
    models = PointerProperty(type=OACollectModels)
    tags = CollectionProperty(type=OATagKey)

    valid_icon_file = BoolProperty(name="", default = False)
    more_objects = BoolProperty(name = "more_objects", default = False)
    shift = BoolProperty(name = "shift", default = False)
    file_valid = BoolProperty(default=False)
    rotation_angle = FloatProperty(default=pi/2, subtype='ANGLE')

    menu_columns = IntProperty(default=4, min=1, max=100)
    menu_icon_display_size = IntProperty(default=40, min=10, max=200)
    menu_icon_size = IntProperty(default=40, min=10, max=200)
    draw_snap_points = BoolProperty(default=True)

    insert_at_cursor_pos = BoolProperty(default=False)
    replace_model = BoolProperty(default=False)
    
    order_models_start = StringProperty(default="")
    order_models_end = StringProperty(default="")
    order_function = EnumProperty(items=[
            ("(((10**4)**x)-1)/((10**4)-1)", "Exponential", "", "", 0),
            ("x**(1/0.2)", "Hard", "", "", 1),
            ("x**(1/0.5)", "Soft", "", "", 2),
            ("x", "Linear", "", "", 3),
            ], name="Function", default="x")
    order_tags = CollectionProperty(type=OAModelTag)

    select_oa_type = EnumProperty(items=[
            ("IMPL", "Implementation", "", "", 0),
            ("SIMP", "Simple", "", "", 1),
            ("SIMP_IMPL", "Simple, Implementation", "", "", 2),
            ], name="OA-Type", default="SIMP_IMPL")
    select_id = IntVectorProperty(default=(0,0,0), min=0)
    select_use_id = BoolProperty(default=False)
    select_tags = CollectionProperty(type=OAModelTag)

    snap_point_limit = IntProperty(default=1000)

    convert_real = BoolProperty(default=True)
    convert_rm_sp = BoolProperty(default=True)
    convert_local_sel_obj = BoolProperty(default=False)
    convert_local_sel_objdata = BoolProperty(default=False)
    convert_local_sel_objdata_mat = BoolProperty(default=True)
    convert_local_all = BoolProperty(default=False)
    convert_single_obj = BoolProperty(default=False)
    convert_single_obj_data = BoolProperty(default=False)
    convert_single_obj_data_mat_tex = BoolProperty(default=False)
    convert_single_mat_tex = BoolProperty(default=False)
    convert_single_anim = BoolProperty(default=False)
예제 #24
0
class StoredViewsData(PropertyGroup):
    pov_list = CollectionProperty(type=POVData)
    layers_list = CollectionProperty(type=LayersData)
    display_list = CollectionProperty(type=DisplayData)
    view_list = CollectionProperty(type=ViewData)
    mode = EnumProperty(name="Mode",
                        items=[('VIEW', 'View', ''), ('POV', 'POV', ''),
                               ('LAYERS', 'Layers', ''),
                               ('DISPLAY', 'Display', '')],
                        default='VIEW')
    current_indices = IntVectorProperty(size=4, default=[-1, -1, -1, -1])
    view_modified = BoolProperty(default=False)
예제 #25
0
class SelectionOperator(bpy.types.Operator):
    """ Custom selection """
    bl_idname = "view3d.select_custom"
    bl_label = "Custom selection"

    extend = BoolProperty(default=False)
    deselect = BoolProperty(default=False)
    toggle = BoolProperty(default=False)
    center = BoolProperty(default=False)
    enumerate = BoolProperty(default=False)
    object = BoolProperty(default=False)
    location = IntVectorProperty(default=(0, 0), subtype='XYZ', size=2)

    @classmethod
    def poll(cls, context):
        return context.area.type == 'VIEW_3D' and context.mode == 'OBJECT'

    def execute(self, context):
        deactivate = ''
        if context.active_object:
            obname = context.active_object.name
            deactivate = obname.startswith(
                'BLS_CONTROLLER.') or obname.startswith('BLS_LIGHT_MESH.')

        bpy.ops.view3d.select(extend=self.extend,
                              deselect=self.deselect,
                              toggle=self.toggle,
                              center=self.center,
                              enumerate=self.enumerate,
                              object=self.object,
                              location=(self.location[0], self.location[1]))
        if context.active_object:
            obname = context.active_object.name
            if obname.startswith('BLS_CONTROLLER.'):
                lno = obname.split('.')[1]
                lno = context.scene.objects.find('BLS_LIGHT_MESH.' + lno)
                if lno is not -1:
                    context.scene.objects[lno].select = True

            if deactivate or obname.startswith(
                    'BLS_CONTROLLER.') or obname.startswith('BLS_LIGHT_MESH.'):
                refreshMaterials()

            context.scene.frame_current = context.scene.frame_current
            refreshMaterials()

        return {'FINISHED'}

    def invoke(self, context, event):
        self.location[0] = event.mouse_region_x
        self.location[1] = event.mouse_region_y
        return self.execute(context)
예제 #26
0
class OctaneGeometryExporterTextureQuality(OctaneBaseSocket):
    bl_idname="OctaneGeometryExporterTextureQuality"
    bl_label="Texture quality"
    color=consts.OctanePinColor.Int
    octane_default_node_type="OctaneImageResolution"
    octane_pin_id: IntProperty(name="Octane Pin ID", default=531)
    octane_pin_type: IntProperty(name="Octane Pin Type", default=consts.PinType.PT_INT)
    octane_socket_type: IntProperty(name="Socket Type", default=consts.SocketType.ST_INT2)
    default_value: IntVectorProperty(default=(256, 256), update=None, description="When exporting materials this is the resolution. \n                                 Ignored, if export materials is disabled", min=-2147483648, max=2147483647, soft_min=-2147483648, soft_max=2147483647, step=1, subtype="NONE", size=2)
    octane_hide_value=False
    octane_min_version=0
    octane_end_version=4294967295
    octane_deprecated=False
예제 #27
0
class OctaneScatterInVolumeDimensions(OctaneBaseSocket):
    bl_idname="OctaneScatterInVolumeDimensions"
    bl_label="Dimension"
    color=consts.OctanePinColor.Int
    octane_default_node_type="OctaneIntValue"
    octane_pin_id: IntProperty(name="Octane Pin ID", default=31)
    octane_pin_type: IntProperty(name="Octane Pin Type", default=consts.PinType.PT_INT)
    octane_socket_type: IntProperty(name="Socket Type", default=consts.SocketType.ST_INT3)
    default_value: IntVectorProperty(default=(3, 3, 3), update=None, description="Number of instances along each dimension", min=1, max=1000, soft_min=1, soft_max=1000, step=1, subtype="NONE", size=3)
    octane_hide_value=False
    octane_min_version=0
    octane_end_version=4294967295
    octane_deprecated=False
예제 #28
0
class MaterialGroup(PropertyGroup):
    material: PointerProperty(name="Material", type=bpy.types.Material)

    color: IntVectorProperty(size=3, name="color", min=0, max=255)

    object_color = FloatVectorProperty(name="object_color",
                                       subtype="COLOR",
                                       default=(1.0, 1.0, 1.0),
                                       min=0.0,
                                       max=1.0,
                                       description="color picker")

    alpha: FloatProperty(min=0., max=1)
예제 #29
0
class PathPropertyGroup(PropertyGroup):
    use_random: BoolProperty(
        name="Random Path",
        default=True,
        description="Check this to ensure the path is chosen randomly")

    force_outside: BoolProperty(
        name="Force Outside Path",
        description=
        "Force the maze solution to start and end on the outside of the maze",
        default=False,
    )

    force_start: IntVectorProperty(
        name="Start Maze Here",
        size=2,
    )

    force_end: IntVectorProperty(
        name="End Maze Here",
        size=2,
    )
class JK_MMT_Retarget_Props(bpy.types.PropertyGroup):

    Retarget_method: EnumProperty(
        name="Retargeting Translation",
        description="Set bone translation retargeting",
        items=[('SKELETON', 'Skeleton', "Use translation from skeleton"),
               ('ANIMATION', 'Animation', "Use translation from animation")],
        #('ANIMATION_SCALED', 'Animation Scaled', "Use translation and scale from animation"),
        #('ANIMATION_RELATIVE', 'Animation Relative', "Use translation and scale from animation"),
        #('ORIENT_SCALE', 'Orient and Scale', "Use translation and scale from animation")],
        default='SKELETON')

    Retarget_type: EnumProperty(
        name="Retarget Type",
        description="Set the retarget type. (only used while retargeting)",
        items=
        [('NONE', 'Manual', "Manually assign rotation"),
         ('STRETCH', 'Stretch', "Stretches to target"),
         ('TWIST_HOLD', 'Twist Hold',
          "Holds back the Y rotation. (eg: Upper Arm Twist)"),
         ('TWIST_FOLLOW', 'Twist Follow',
          "Follows targets Y rotation. (eg: Lower Arm Twist)"),
         ('ROOT_COPY', 'Root Copy',
          "Copies world space rotation of it's parent"),
         ('IK_DEFAULT', 'IK Default',
          "Is an IK deform bone present in the default rig. (You will need to remove/set this bone up yourself)"
          ),
         ('REMOVE', 'Remove',
          "Get rid of this bone when applying control bones")],
        default='NONE')

    Subtarget: StringProperty(
        name="Subtarget",
        description="Subtarget during retargeting (if any)",
        default="",
        maxlen=1024,
    )

    Mapping_indices: IntVectorProperty(
        name="Mapping Indices",
        description="Indices used to map this bone between armatures",
        default=(-1, -1, -1),
        size=3,
    )

    Control_name: StringProperty(
        name="Control Name",
        description="Controlling bone",
        default="",
        maxlen=1024,
    )