State:New|TargetRelease:No Target|icon_bug|icon_katana|database:public|Resolution:Fixed|BugID:309808|
Problem summary:
There appear to be several inconsistencies in signatures of functions of asset plug-ins between C++ and Python implementations, which can lead to confusion for developers of asset plug-ins, and to unexpected exceptions.
A header file that defines the class that is used to access the currently set asset management system plug-in is available in the plugin_apis directory of a Katana installation:
plugin_apis/include/FnAsset/FnDefaultAssetPlugin.h A base class for Python-based asset plug-ins is available in compiled form in the bin directory of a Katana installation:
bin/python/AssetAPI/BaseAssetPlugin.pyc
An example implementation of a Python-based asset plug-ins is available in the plugins directory a Katana installation:
plugins/Src/Resources/Examples/AssetPlugins/MockAsset.py Examples of inconsistencies are:
Steps to reproduce:
cat ./plugins/Src/Resources/Examples/AssetPlugins/MockAsset.py | grep "def getAssetFields"
def getAssetFields(self, assetId, includeDefaults = False):
AssetAPI.GetDefaultAssetPlugin().getAssetFields('some asset ID') Expected behaviour:
The function runs and returns a dictionary of asset fields for the given asset ID, e.g.
{'path': 'some asset ID', 'name': 'some asset ID'} Actual behaviour:
An exception is raised, and the following error message is shown:
TypeError: Required argument 'includeDefaults' (pos 2) not found Workaround:
Call getAssetFields() with a boolean argument for the includeDefaults parameter:
AssetAPI.GetDefaultAssetPlugin().getAssetFields('some asset ID', False) Reproduced versions/platforms:
We're sorry to hear that
Please tell us why