Hi, i use setup excel sheet from fusion post to get my strategys, in the excell makes a print screen, the problem is that my background color is black, and the image captured imagem cames in black when printing,
can somehelp help me change the post to capture imagem with transparent background?
i know there is a option in capture imagem, but my post has no comand to capture imagem to transparent.
Solved! Go to Solution.
Solved by BrianEkins. Go to Solution.
Hello @nubrandao ,
Due to limited access to the post engine, we can’t set a background color for the model image, as it’s defined by the line keywords = "MODEL_IMAGE PREVIEW_IMAGE";
. Unlike in Fusion, we don’t have direct access to modify settings through the post processor while capturing images.
We could technically change the RGB values using a canvas, drawing the same image pixel by pixel to apply a background color. However, this approach has drawbacks: the background color must be uniform and cannot overlap with the model colors. Additionally, I'm unsure how much processing time it would require, so I wouldn’t recommend it.
Let me know if you have any other idea!!!
You can use the API to set any options in the Rendering workspace. Below is a simple sample that renders the active design with a transparent background.
import adsk.core, adsk.fusion, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
des: adsk.fusion.Design = app.activeProduct
root = des.rootComponent
# Get the RenderManager from the Design and set the resolution of the output image.
rm = des.renderManager
render = rm.rendering
render.resolution = adsk.fusion.RenderResolutions.Mobile1920x1080RenderResolution
render.isBackgroundTransparent = True
# Define the filename for this frame.
filename = 'C:/Temp/RenderSample.png'
# Start the render.
future = render.startLocalRender(filename)
waiting = True
while waiting:
if future.renderState != adsk.fusion.LocalRenderStates.ProcessingLocalRenderState:
waiting = False
if future.renderState == adsk.fusion.LocalRenderStates.FinishedLocalRenderState:
ui.messageBox(f'Render is finished to: {filename}.')
elif future.renderState == adsk.fusion.LocalRenderStates.FailedLocalRenderState:
ui.messageBox('Rendering Failed.')
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Can't this command be add to the post setup Excell?
At the top?
So everytime it runs the post, it will change background to transparent right?
This doesn't change the background. It uses the Rendering functionality associated with the Design to create a new ray-traced image with a transparent background. I don't know if it will work while the Manufacturing workspace is active, but you can try it and see.
Can't find what you're looking for? Ask the community or share your knowledge.