Change Stack Mode with Python

Hello!

I would like to know if I could change the Stack Mode directly with Python like in the picture shown, I was thinking that
the setCompositeMode was my entry ticket but I can’t get it working at the moment. Any idea?

image

Best regards,

Dimitri

I set it using rvpush to an existing running session like:

cmd = f"rvpush -tag {tag} py-eval \"[rv.commands.setStringProperty(f'{{stack}}.composite.type', ['replace'], True) for stack in rv.commands.nodesOfType('RVStack')]\""

subprocess.run(cmd)  

You can change “replace” to “Difference” or whatever you want.

This might not be exactly how you do it, but at least it shows what types of rv.commands that you can use.

3 Likes

Hi,

Thanks for the reply and feedback, I wasn’t aware that I could use setStringProperty to interact with rv this way. Since I launched my stack creation with python, I ended up by directly doing this:

[rv.commands.setStringProperty(‘{stack}.composite.type’.format(stack=stack), [‘replace’], True) for stack in rv.commands.nodesOfType(‘RVStack’)]

Best regards,

Dimitri

1 Like