Project or Worspace path through api

Good morning everyone.
After spending quite some time between examples and API documentation I’m finding myself lost on how to retrieve informations about the current project. Such as where is it saved and how to save / load it through the api themselves.

I’ve been checking in the PyProject as well as PyWorkspace, but neiter seems to contain useful method for what I’m after.

Does anyone has any direction to give in case ? Is wiretap the way to go ?
Cheers.

L

Wiretap.

2 Likes
/opt/Autodesk/wiretap/tools/current/wiretap_create_node --help

Wiretap API

Example:

    # Create a logik projekt flame projekt node using wiretap
    /opt/Autodesk/wiretap/tools/current/wiretap_create_node \
    -n /volumes/stonefs_2025 \
    -d "$name" \
    -s XML \
    -f "$projekt_metadata_xml_file" \
<Project>
    <Name>rainbow_unicorns_flame01</Name>
    <Nickname>rainbow_unicorns</Nickname>
    <ShotgunProjectName>rainbow_unicorns</ShotgunProjectName>
    <SetupDir>rainbow_unicorns_flame_01</SetupDir>
    <Partition>stonefs_2025</Partition>
    <FrameWidth>1920</FrameWidth>
    <FrameHeight>1080</FrameHeight>
    <FrameDepth>16-bit fp</FrameDepth>
    <AspectRatio>1.77778</AspectRatio>
    <FieldDominance>PROGRESSIVE</FieldDominance>
    <FrameRate>23.976 fps</FrameRate>
    <DefaultStartFrame>1001</DefaultStartFrame>
</Project>
2 Likes

Thank you @ALan and @philm
Will this works also if the project has been manually created locally through the UI ? I’ll check the Wiretap API in the meanwhile, thanks !

1 Like
/opt/Autodesk/wiretap/tools/current/wiretap_get_children -n /projects

returns a list of projects
e.g.

/projects/alpha_bravo_charlie_flame01
/projects/rainbow_unicorns_flame01
/projects/xray_yankee_zulu_flame01

so then you can try:

/opt/Autodesk/wiretap/tools/current/wiretap_get_children -N -n /projects/rainbow_unicorns_flame01
`

and you can also use:
`/opt/Autodesk/wiretap/tools/current/wiretap_resolve_path -p /projects/rainbow_unicorns_flame01`
1 Like

If you want to load a project you can run:

/opt/Autodesk/flame_$VERSION/bin/startFlame -J rainbow_unicorns_flame01
1 Like

Project setup files are saved in /opt/Autodesk/project/rainbow_unicorns_flame01

Project stone+wire data (in my case) can be found in

/opt/Autodesk/clip/stonefs_2020
/opt/Autodesk/clip/stonefs_2021
/opt/Autodesk/clip/stonefs_2022
/opt/Autodesk/clip/stonefs_2023
/opt/Autodesk/clip/stonefs_2024
/opt/Autodesk/clip/stonefs_2025/rainbow_unicorns_flame01
/opt/Autodesk/clip/stonefs_2026
/opt/Autodesk/clip/stonefs_2027
1 Like

Thank you all !
I’ve started looking into wiretap and its python api .
Your examples are extremely useful.
Cheers!
L.

Share your results…

I Will as soon as I’ve something up and running :wink:
I’m doing all my api testing on an EC2 and can be tad slow at times :smiley:

1 Like

To retrieve information about the current project in PyProject or PyWorkspace API, you can use the pyproject.api.project module. Specifically, you can use the get_project_path() method to retrieve the current project’s path.

1 Like

@maxim344 - nice
Write an example

Hi @maxim344 , might be due to a different Flame version (I’m on 2023) but cannot get to access the api submodule of PyProject or PyWorkspace.

eg:

from flame import PyProject, PyWorkspace
from pprint import pformat

print(pformat(dir(PyProject)))
print(pformat(dir(PyWorkspace)))

with the following result (hiding protected and private methods)

[ 
...
'attributes',
 'commit',
 'create_shared_library',
 'current_workspace',
 'get_wiretap_node_id',
 'get_wiretap_storage_id',
 'name',
 'nickname',
 'parent',
 'project_name',
 'refresh_shared_libraries',
 'shared_libraries',
 'workspaces_count'
]


[
...
 'attributes',
 'commit',
 'create_library',
 'desktop',
 'get_wiretap_node_id',
 'get_wiretap_storage_id',
 'libraries',
 'parent',
 'replace_desktop',
 'set_desktop_reels',
 'set_freeform']

Atm I’m diving head down in the wiretap api , trying to see how deep is the rabbit hole :wink:

@philm as you were curious about progresses, this is how far I got :slight_smile:

from adsk.libwiretapPythonClientAPI import (
    WireTapClientInit,
    WireTapNodeHandle,
    WireTapServerHandle,
    WireTapClientUninit
)


xml_settings = '''
<Project>
<Name>MyProjectName</Name>
<Description>"API created"</Description>
<FrameWidth>1920<FrameWidth>
<FrameHeight>1080<FrameHeight>
<FrameDepth>10-bit</FrameDepth>
<AspectRatio>1.777</AspectRatio>
<FieldDominance>PROGRESSIVE</FieldDominance>
<FrameRate>25</FrameRate>
<VisualDepth>unknown</VisualDepth>
</Project>
'''


project_name = 'MYTESTPROJECT'
workspace_name = 'MYTESTWORKSPACE'
user_name = 'MYTESTUSER'


WireTapClientInit()

server = WireTapServerHandle('localhost:IFFFS')

# create user
empty_user_node = WireTapNodeHandle()
new_users_node = WireTapNodeHandle(server, "/users")
new_users_node.createNode(user_name,'USER', empty_user_node)

# create project
empty_project_node = WireTapNodeHandle()
new_project_node = WireTapNodeHandle(server, '/projects')
new_project_node.createNode(project_name,'PROJECT', empty_project_node)

workspace_empty_node = WireTapNodeHandle()
new_worspace_project_node = WireTapNodeHandle(server, f'/projects/{project_name}')
new_worspace_project_node.setMetaData('XML', xml_settings)

# create workspace

new_project_node.createNode(workspace_name, 'WORKSPACE', workspace_empty_node)

WireTapClientUninit()

Still a lot to learn and look into, but at least is not erroring and I can see the data being present.

More to come (hopefully soon)
Cheers.
L.

p.s
Just found this … looking up online earlier would have saved me quite some headaches :stuck_out_tongue:

1 Like

@langeli - good work.
Sharing is caring….
Or is it sharing is scary?
Can’t remember!
:rofl:

1 Like

The project node usually needs to be created with the stonefs volume node as the parent node. The gitlab code you found shows a good example of how to determine the stonefs volume to create the project node under

@creonovo , yes you are right, and that code actually helped me out getting a better understanding on things works.

@langeli

Start here to see “what’s new” and follow the versions to check what python additions and deprecations have happened since 2023.

@philm I’ll check thanks!
I just want to be sure to target some older versions as is what’s usually used in production :wink: (latest -1 at least by my experience)

@langeli - it’s a good work ethos to support what went before.

I personally don’t have this belief - fck all that old sht, move on…

The wiretap tools appear to be largely unchanged for many years, although occasionally there are undocumented improvements/modifcations.

This means that your tools will mostly work, with little to no maintenance.

If wiretap disappears you’ll need to find a new approach, obviously…

1 Like