11-20-2019, 03:12 AM
I just added this to the vfx project:
<search_type name="vfx/asset_in_asset" xpos="528" ypos="187"/>
<connect from="vfx/asset_in_asset" to="vfx/asset" from_node="vfx/asset_in_asset" to_node="vfx/asset" relationship="code" from_col="parent_asset_code" to_col="code" path="parent"/>
<connect from="vfx/asset_in_asset" to="vfx/asset" from_node="vfx/asset_in_asset" to_node="vfx/asset" relationship="code" from_col="child_asset_code" to_colr="code" path="child"/>
And then wrote a quick test script:
import tacticenv
from pyasm.security import Batch
Batch(project_code="my_first_project")
from pyasm.search import Search
skey = "vfx/asset?project=my_first_project&code=ASSET00002"
asset = Search.get_by_search_key(skey)
assets = Search.eval("@SOBJECT(parent:vfx/asset_in_asset.child:vfx/asset)", asset)
for asset in assets:
print(asset.get_search_key())
This produced the correct result ... mind you this was in 4.7 using python3.
<search_type name="vfx/asset_in_asset" xpos="528" ypos="187"/>
<connect from="vfx/asset_in_asset" to="vfx/asset" from_node="vfx/asset_in_asset" to_node="vfx/asset" relationship="code" from_col="parent_asset_code" to_col="code" path="parent"/>
<connect from="vfx/asset_in_asset" to="vfx/asset" from_node="vfx/asset_in_asset" to_node="vfx/asset" relationship="code" from_col="child_asset_code" to_colr="code" path="child"/>
And then wrote a quick test script:
import tacticenv
from pyasm.security import Batch
Batch(project_code="my_first_project")
from pyasm.search import Search
skey = "vfx/asset?project=my_first_project&code=ASSET00002"
asset = Search.get_by_search_key(skey)
assets = Search.eval("@SOBJECT(parent:vfx/asset_in_asset.child:vfx/asset)", asset)
for asset in assets:
print(asset.get_search_key())
This produced the correct result ... mind you this was in 4.7 using python3.