def get_autotags():
    """ call all analysis functions """
    ui = bpy.context.scene.blenderkitUI
    if ui.asset_type == 'MODEL':
        ob = utils.get_active_model()
        obs = utils.get_hierarchy(ob)
        props = ob.blenderkit
        if props.name == "":
            props.name = ob.name

        # reset some properties here, because they might not get re-filled at all when they aren't needed anymore.
        props.texture_resolution_max = 0
        props.texture_resolution_min = 0
        # disabled printing checking, some 3d print addon bug.
        # check_printable( props, obs)
        check_render_engine(props, obs)

        dim, bbox_min, bbox_max = utils.get_dimensions(obs)
        props.dimensions = dim
        props.bbox_min = bbox_min
        props.bbox_max = bbox_max

        check_rig(props, obs)
        check_anim(props, obs)
        check_meshprops(props, obs)
        check_modifiers(props, obs)
        countObs(props, obs)
    elif ui.asset_type == 'MATERIAL':
        # reset some properties here, because they might not get re-filled at all when they aren't needed anymore.

        mat = utils.get_active_asset()
        props = mat.blenderkit
        props.texture_resolution_max = 0
        props.texture_resolution_min = 0
        check_material(props, mat)
Esempio n. 2
0
def auto_fix(asset_type=''):
    #this applies various procedures to ensure coherency in the database.
    asset = utils.get_active_asset()
    props = utils.get_upload_props()
    if asset_type == 'MATERIAL':
        overrides.ensure_eevee_transparency(asset)
        asset.name = props.name
Esempio n. 3
0
def get_autotags():
    """ call all analysis functions """
    ui = bpy.context.scene.blenderkitUI
    if ui.asset_type =='MODEL':
        ob = utils.get_active_model()
        obs = utils.get_hierarchy(ob)
        props = ob.blenderkit
        if props.name == "":
            props.name = ob.name

        # reset some properties here, because they might not get re-filled at all when they aren't needed anymore.
        props.texture_resolution_max = 0
        props.texture_resolution_min = 0
        # disabled printing checking, some 3d print addon bug.
        # check_printable( props, obs)
        check_render_engine(props, obs)

        dim, bbox_min, bbox_max = utils.get_dimensions(obs)
        props.dimensions = dim
        props.bbox_min = bbox_min
        props.bbox_max = bbox_max

        check_rig(props, obs)
        check_anim(props, obs)
        check_meshprops(props, obs)
        check_modifiers(props, obs)
        countObs(props, obs)
    elif ui.asset_type =='MATERIAL':
        # reset some properties here, because they might not get re-filled at all when they aren't needed anymore.

        mat = utils.get_active_asset()
        props = mat.blenderkit
        props.texture_resolution_max = 0
        props.texture_resolution_min = 0
        check_material(props, mat)
Esempio n. 4
0
def draw_ratings(layout, context):
    # layout.operator("wm.url_open", text="Read rating instructions", icon='QUESTION').url = 'https://support.google.com/?hl=en'
    asset = utils.get_active_asset()
    bkit_ratings = asset.bkit_ratings

    ratings.draw_rating(layout, bkit_ratings, 'rating_quality', 'Quality')
    layout.separator()
    layout.prop(bkit_ratings, 'rating_work_hours')
    w = context.region.width
Esempio n. 5
0
def draw_ratings(layout, context):
    # layout.operator("wm.url_open", text="Read rating instructions", icon='QUESTION').url = 'https://support.google.com/?hl=en'
    asset = utils.get_active_asset()
    # the following shouldn't happen at all in an optimal case,
    # this function should run only when asset was already checked to be existing
    if asset == None:
        return
    bkit_ratings = asset.bkit_ratings

    ratings.draw_rating(layout, bkit_ratings, 'rating_quality', 'Quality')
    layout.separator()
    layout.prop(bkit_ratings, 'rating_work_hours')
    w = context.region.width
Esempio n. 6
0
def draw_ratings(layout, context):
    # layout.operator("wm.url_open", text="Read rating instructions", icon='QUESTION').url = 'https://support.google.com/?hl=en'
    asset = utils.get_active_asset()
    bkit_ratings = asset.bkit_ratings

    ratings.draw_rating(layout, bkit_ratings, 'rating_quality', 'Quality')
    layout.separator()
    layout.prop(bkit_ratings, 'rating_work_hours')
    w = context.region.width

    layout.label(text='problems')
    layout.prop(bkit_ratings, 'rating_problems', text='')
    layout.label(text='compliments')
    layout.prop(bkit_ratings, 'rating_compliments', text='')

    row = layout.row()
    op = row.operator("object.blenderkit_rating_upload", text="Send rating", icon='URL')
    return op
Esempio n. 7
0
 def invoke(self, context, event):
     wm = context.window_manager
     asset = utils.get_active_asset()
     upload_rating(asset)
     return wm.invoke_props_dialog(self)
Esempio n. 8
0
 def execute(self, context):
     asset = utils.get_active_asset()
     props = asset.bkit_ratings
     props[self.property_name] = self.rating
     return {'FINISHED'}
Esempio n. 9
0
 def execute(self, context):
     asset = utils.get_active_asset()
     props = asset.bkit_ratings
     props.rating_quality = self.rating
     return {'FINISHED'}