Scrape file paths for entire project?



  • On 29/06/2017 at 13:14, xxxxxxxx wrote:

    hi,

    I don't know what I am doing -

    Now that's out of the way.

    I am trying to write a python script that will do the following:

    convert all windows file paths (alembic, bitmaps, everything with a file path) to linux paths.

    then export a RedShift proxy file that I will then submit to a linux farm (that part I have sorted out - sort of)

    so P:\blah to //volumes/projects/blah

    Is there way to do this for an entire document - including red shift material paths?

    I can't find anything in the python ref pages that refers to this specific task.

    Thanks.
    rand.



  • On 30/06/2017 at 02:13, xxxxxxxx wrote:

    Hi rand,

    welcome to the Plugin Café forums 🙂

    I think, actually the easiest way to achieve something like this is to use the "Save Project with Assets..." command from the File menu. This will change all file references into relative ones and copy all assets into the (new) project directory.

    Internally this is achieved by sending MSG_GETALLASSETS followed by a MSG_MULTI_CLEARSUGGESTEDFOLDER to all parts of a scene. But this can not be used to arbitrarily change filepaths, but only to convert absolute paths to relative ones.

    If you really need to change filenames in an arbitrary way, you would need to walk everything contained in a scene (objects, materials, shaders, tags, ...) and then it's probably easiest to search the Description for Filename parameters.

    In our C++ docs we have a few manuals that may help you understand the details here:
    GeListNode manual for iteration of scene elements.
    - Description manual
    - NodeData::Message() manual on above mentioned messages


Log in to reply