use AssetWidget from openpype.tool

This commit is contained in:
iLLiCiTiT 2021-10-27 18:14:17 +02:00
parent 2207d3a279
commit 7c1ad1883d
2 changed files with 4 additions and 7 deletions

View file

@ -4,8 +4,8 @@ import contextlib
import logging
from Qt import QtCore, QtGui
from avalon.tools.widgets import AssetWidget
from avalon import style
from openpype.tools.utils.widgets import AssetWidget
from avalon import style, io
from pxr import Sdf
@ -31,7 +31,7 @@ def pick_asset(node):
# Construct the AssetWidget as a frameless popup so it automatically
# closes when clicked outside of it.
global tool
tool = AssetWidget(silo_creatable=False)
tool = AssetWidget(io)
tool.setContentsMargins(5, 5, 5, 5)
tool.setWindowTitle("Pick Asset")
tool.setStyleSheet(style.load_stylesheet())
@ -41,8 +41,6 @@ def pick_asset(node):
# Select the current asset if there is any
name = parm.eval()
if name:
from avalon import io
db_asset = io.find_one({"name": name, "type": "asset"})
if db_asset:
silo = db_asset.get("silo")

View file

@ -8,8 +8,7 @@ from avalon.api import AvalonMongoDB
from openpype import style
from openpype.api import resources
from avalon.tools import lib as tools_lib
from avalon.tools.widgets import AssetWidget
from openpype.tools.utils.widgets import AssetWidget
from avalon.vendor import qtawesome
from .models import ProjectModel
from .lib import get_action_label, ProjectHandler