Fu ViewInfo position data omitted from .comp file when saving through fuscript

Moderator: Chad

aardschok
Posts: 4
Joined: Thu Feb 01, 2018 6:03 am

ViewInfo position data omitted from .comp file when saving through fuscript

#1

Post by aardschok » Fri Apr 13, 2018 9:23 am

Fusion version:
9.0.2

OS and version:
Windows 7, servicepack 1

Additional relevant system info:
Python 2.7

Description of the bug:
We run a composition update script by starting a server and import BlackmagicFusion and get a new Fusion instance to work in.
We open a comp made by an artist and update the paths of all the loaders in the comp and the output of the saver if needed.

After we have updated all the Loaders in the composition file and saved it as a new version we experience the issue of all the loaders being
stacked atop of each other in the exact same spot.

After testing this manually by opening a comp in fuscript (args -i -l py2) and save as another then comparing both files
we found that the ViewInfo's position data is omitted from the file, there for, after opening it again in Fusion.exe it shows as described


Severity (Trivial, Minor, Major, Critical)
Major

Steps to reproduce:

Code: Select all

import subprocess
import time
import BlackmagicFusion as bmf

def get_fusion_instance(pid, srv, timeout=10):
    """Get the fusion instance which has been launched

    Args:
        pid (int, long): process id
        srv (PyObject): fusion server instance
        timeout (float): how long the function needs to time out in between
                         attempts

    Returns:
        fusion

    """

    count = 0
    host = None
    while not host:
        if count > timeout:
            break
        fusion_hosts = srv.GetHostList().values()
        host = next((i for i in fusion_hosts if int(i["ProcessID"]) == pid),
                    None)
        if not host:
            print("Find Fusion host... (%ss)" % count)
            time.sleep(0.5)
            count += 0.5

    assert host, "Fusion not found with pid: %s" % pid

    return bmf.scriptapp(host["Name"], "localhost", 2, host["UUID"])

# Start console node
proc = subprocess.Popen("C:/Program Files/Blackmagic Design/Fusion Render Node 9/fusionconsolenode.exe", args="/listen")

# Start server
srv = srv = bmf.scriptapp("", "localhost", 1)
if not srv:
    srv = bmf.startserver()
    
fusion = get_fusion_instance(proc.pid, srv)

# Load comp 
comp = fusion.LoadComp("C:/comp_a.comp")

# Lets assume all loaders have file which are from "C:/images/v001"
# and we want to update them to "C:/images/v002" (all image files are present in both version folder)

comp.Lock()
for tool in comp.GetToolList(False, "Loader").values():
    current_clip = tool["Clip"]
    new_clip = current_clip.replace("v001", "v002")
    tool["Clip"] = new_clip
comp.Unlock()

comp_filename = comp.GetAttrs("COMPS_FileName")
new_comp_filename = "C:/comp_b.comp"

Please, if possible, provide a Fusion setup to help demonstrate the behaviour, either as an attachment or between [code] tags:

BigRoyNL
Fusioneer
Posts: 75
Joined: Wed Oct 29, 2014 5:51 am
Been thanked: 1 time

Re: ViewInfo position data omitted from .comp file when saving through fuscript

#2

Post by BigRoyNL » Fri Apr 13, 2018 9:47 am

I think this needs some tl;dr explanation, in short:

Whenever you use the fusionconsolenode to save a comp (e.g. load a comp and then save it) then it loses all ViewInfo information, thus when opening it with Fusion manually afterwards all nodes are laid out on top of each other.

Currently we've found no way to preserve this information in the file.

User avatar
Chad
Fusionator
Posts: 1390
Joined: Fri Aug 08, 2014 1:11 pm
Been thanked: 11 times

Re: ViewInfo position data omitted from .comp file when saving through fuscript

#3

Post by Chad » Fri Apr 13, 2018 11:07 am

All or just the Loaders?

BigRoyNL
Fusioneer
Posts: 75
Joined: Wed Oct 29, 2014 5:51 am
Been thanked: 1 time

Re: ViewInfo position data omitted from .comp file when saving through fuscript

#4

Post by BigRoyNL » Sun Apr 15, 2018 7:54 am

Chad wrote:
Fri Apr 13, 2018 11:07 am
All or just the Loaders?
All tools in the Comp. Basically no ViewInfo information remains in the file afterwards, it is missing from the saved .comp file when saved from the Fusion console node through fuscript.

User avatar
SecondMan
Site Admin
Posts: 3416
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 4
Location: Vancouver, Canada
Been thanked: 78 times
Contact:

Re: ViewInfo position data omitted from .comp file when saving through fuscript

#5

Post by SecondMan » Wed May 15, 2019 9:05 pm

Some extra information for this one. This is only true for RenderNodes. Loading, manipulating, and saving a comp on a RenderNode through script does lose some info. It was never really intended to save out comps.

So arguably this becomes more a Wish List item, though it does seem counter-intuitive that the same scripts would yield different results in what is perceived to be the same core application...

@aardschok, @BigRoyNL - any further thoughts?