Giter Site home page Giter Site logo

asset_browser_utilities's Introduction

This add-on aims to provide several utilities to reduce the time it takes to do operations on large libraries :

Features :

  • Mark Items as Assets

  • Unmarks Assets

  • Export Assets

Export assets from the current file.

You can choose an existing file to append the assets to, or a new filepath will create a brand new file with the assets.

  • Import Assets

  • Copy From Active To Selected

capture (2)

  • Custom Operation(s)

  • Add Tags

  • Remove Tags

  • Add "Smart" tags

image

capture

  • Generate Image Previews

  • Setup image previews from disk

Select a folder on disk containing previews and the addon will automatically match the image files named like assets in the file with their preview.

BES_49

  • Extract asset thumbnails to disk

capture (1)

  • Move To or Remove From Catalog

  • Set Author, Description, Copyright, License

  • Copy folder structure as catalogs and place assets

image

Example of asset directory

image

Result after executing the sort operation

image

  • Merge or Replace Materials or Node Trees image

Merge : Before

image

After

image

Specifics :

  1. Filters

All operators feature a selection set which can be setup in depth to ensure specific asset selections image

  • Filter by selection (Asset Browser or 3D viewport)
  • Filter By item type
  • Filter by item name
  • Filter by catalog (when applicable)
  • Filter by Tag
  • Filter by Author
  1. Defaults and presets

Define default values and presets inside the addon preferences

image

Setup the preset on top of the operator popup panel

image

4.Custom Operations

Add custom operations on top of batch operations, like applying transforms to all assets

image capture

Use the custom operation standalone

image

  1. Progress Bar !

animation

asset_browser_utilities's People

Contributors

gorgious56 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

asset_browser_utilities's Issues

Backup inflation problem

So this is not really a bug but a limitation of the system that needs the file to be saved for the assets to be registered as marked.

If the user selected the settings "Save Versions" in the preferences, it will create a backup file in place next to all the files that have been treated. This will multiply by 2 the library size for no real reason.

I definitely don't want the script to change the preferences globally, and not even temporarily since if for some reason it crashes mid way it won't reset the value back. I could automatically detect if a new file has been generated and deleting it afterwards, but again this needs to be done carefully so as not to erase unintended files.

releases contain unnecessary __pycache__ folders

Hi! I noticed that there's a considerable file size difference between downloading the main branch and a zipped release.
It turns out that your releases unnecessarily contain compiled python files in the __pycache__ folders and some orphaned folders.

To me it seems as if the release was packed locally from a working space and then uploaded. You could consider using a github action to build the release directly from a clean version. This could look somewhat like the untested setup below.

name: Release Asset Browser Utilities

on:
  push:
    tags:
      - '*'

jobs:
  tagged-release:
    runs-on: ubuntu-latest
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
      - uses: actions/checkout@v2
      - name: Zip Release
        uses: TheDoctor0/zip-release@master
        with:
          path: './'
          filename: 'asset_browser_utilities.zip'
      - name: Get Version Info
        run: |
          echo GH ref: ${{ github.ref }}
          ver=$(echo ${{ github.ref }} | grep -oP "[0-9]+.[0-9]+.[0-9]+-?.*")
          echo Version: $ver
          echo "::set-output name=version::${ver}"
        id: version
      - name: Release
        if: ${{ !endsWith(steps.version.outputs.version, '-pre') }}
        uses: softprops/action-gh-release@v1
        id: create_release
        with:
          name: Asset Browser Utilities ${{ steps.version.outputs.version }}
          files: asset_browser_utilities.zip
          fail_on_unmatched_files: true
          draft: true
          prerelease: false
      - name: Pre-Release
        if: ${{ endsWith(steps.version.outputs.version, '-pre') }}$
        uses: softprops/action-gh-release@v1
        id: create_prerelease
        with:
          name: Asset Browser Utilities ${{ steps.version.outputs.version }}
          files: asset_browser_utilities.zip
          fail_on_unmatched_files: true
          draft: true
          prerelease: true

Export Operator : Set fake user option

For objects that are not immediately linked to another data block, eg materials can exist in a vacuum, they will automatically be deleted from export file on quitting it since they users is set to 0.

Provide option (or maybe force it since in any case if the user wants to export materials, the only way for it to save it is to set it to fake user) to set fake user

Do not generate previews of assets which can't generate a preview

Some assets can't have a generated preview (armature, meshes with no faces, lattice, etc.) the current implementation will run forever waiting for the preview to finish leading to a possible memory leak and other good stuff.

Need to find a way to detect if an asset can have a generated preview

Or to add a timer and stop generating the preview if the timer is reached. However hard to do because for instance materials and complex objects can take several seconds to generate and it depends on the power of the user machine.

Export Assets : Option to export an object which is not an asset in source file, but mark the item as asset in the target file

This would be very nice but a bit awkward since we don't have a handle on appended objects and their name gets changed if there already is an object which name is the same as the appended one.

Would need to store a list of all existing objects in the file, and compare it afterwards when all objects have been appended ?

or maybe add a temporary custom property on the objects...

Import operator

Option to import from one or more files, or from one folder / subfolders

Ensure correct catalogs are parsed

Following 18703ab
and #43

It would be nice to find a way to parse the entire library for a catalogs definition.

Might be worth looking at the source code to see how it's done under the hood by the asset browser

Support all asset types for 3.1

  • Node groups
  • Collections
  • Brushes
  • Cache Files (?)
  • Hairs (?)
  • Images
  • Freestyle Stylelines
  • Masks (?)
  • Meshes
  • Movie Clips
  • Paint Curves (?)
  • Palettes
  • Particle Settings
  • Scenes
  • Simulations (?)
  • Sounds
  • Texts
  • Textures
  • Workspaces

Custom interval time

Let user with a slow computer change the interval if the previews don't render fast enough

Smart Tags

Add an option to setup smart tags. EG : add a tag to objects from one of their properties like scale, location, rotation, or custom properties, object color, etc.

  • Dimensions
  • Tricount (rounded up or down) & Vertcount
  • ID Custom property (user input)
  • Scale

Hi! Won't you help a little? Thank you

I saw that you have experience in checking all subfolders and importing obj from it.

I need a code that searches and imports fbx from all the subfolders in the selected folder. Can you share if you know?

Is there a way to easily know if an asset has a generated preview ?

I noticed assets with blank previews had a preview image pixels set to all black, so I'm doing this

    preview = last_asset.preview
    arr = np.zeros((preview.image_size[0] * preview.image_size[1]) * 4, dtype=np.float32)
    preview.image_pixels_float.foreach_get(arr)
    if np.all((arr == 0)):
        # Preview not generated (all black)

but this seems higlhy inefficient, is there a way to know for a fact a preview has been generated for an asset without having to add a custom property to it ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.