startLocalRender on OSX

startLocalRender on OSX

charliex2
Advocate Advocate
801 Views
9 Replies
Message 1 of 10

startLocalRender on OSX

charliex2
Advocate
Advocate
I have this snipped of code in a plugin, the document is saved, doesn't matter the contents. A simple sphere at 0,0,0 shows the issue
 
r->progress() always returns 0 no matter how long i wait.
 
identical code works just fine on windows, what am i doing wrong? 
 
is there any sort of global error/checking state i can look at it, nothing comes out on the console, normally it seems if the render can't/won't start it'll fail the startLocalRender call, but this passes.
 
 
latest version of fusion on all.
 
OSX 14/XCode 15 beta 6, macbook pro m2 max, i know its a beta/beta combo but i can go check it on a different machine on 13 or earlier as well but i figured i'd check if there was anything obvious i missed.
 
thanks!
 
app is initialised ok, and this is in run, the code does work on windows
 
// Get the active design.
Ptr<Design> design = app->activeProduct();
if (!design)
return false;
 
double propertyValue;
 
Ptr<RenderManager> renderManager_var = design->renderManager();
if (!renderManager_var)
return false;
 
Ptr<Rendering> rendering_var = renderManager_var->rendering();
if (!rendering_var)
return false;
 
// set the rendering properties
rendering_var->resolutionWidth(1000);
rendering_var->resolutionHeight(1000);
rendering_var->renderQuality(100);
 
auto r = rendering_var->startLocalRender();
if ( r ) {
auto propertyValue = r->progress();
}
 
0 Likes
802 Views
9 Replies
Replies (9)
Message 2 of 10

john.kirchner
Autodesk
Autodesk

Have you tried your MacBook making a local render in F360 using the normal UI workflow? That's fine if you use Standard(50) quality, curious if that renders ok.



0 Likes
Message 3 of 10

charliex2
Advocate
Advocate

hiya,

 

using the ui to local render works as expected.

 

i just don't get any progress when using the api , it is always zero, from the future not sure if its actually rendering

 

setting renderQuality(50) same results, 0 progress

 

 

 

0 Likes
Message 4 of 10

john.kirchner
Autodesk
Autodesk

Ignoring the progress value being returned - when using API will the render ever reach 'FinishedLocalRenderState (2)' when you grab renderState?



0 Likes
Message 5 of 10

charliex2
Advocate
Advocate

oops accidentally clicked accept solution there, it does return ProcessingLocalRenderState , running a quick test to see if it changes state.

0 Likes
Message 6 of 10

charliex2
Advocate
Advocate

it stays in QueuedLocalRenderState,  i let it sit for a long time and it never started, xcode showed the wrong enum, but i single stepped a  few times and it never changed, which seems to make more sense given the progress never changes.

 

0 Likes
Message 7 of 10

charliex2
Advocate
Advocate

i tried it from Python (which i knocked up this little test script just to see if it was different) same results on OSX vs Windows, the script isn't bullet proof obviously but it shows the same issue..

 

OSX , progress is 0, then the future disappears and the render is gone. i know the test for the future in the script isn't complete but it happens almost immediately sometimes (And the c++ version does handle the future differently), but never gets to render state 2

 

charliex2_2-1692465939010.png

 

 

 

 

Windows, progress repeats as expected, renderstart popup in the UI is 2

charliex2_0-1692465605848.png

 

 

#Author-
#Description-

import time, adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        design = adsk.fusion.Design.cast(app.activeProduct)
        renderManager = design.renderManager
        rendering = renderManager.rendering

        rendering.renderQuality = 100
        rendering.resolutionWidth = 1000
        rendering.resolutionHeight = 1000
        renderFuture_var = rendering.startLocalRender() 
        renderState = renderFuture_var.renderState

        #ui.messageBox('Render State:\n{}'.format( renderState ))
        # wait until the render state is not 1
        while renderState == 1:
            
            # sleep for 100 milliseconds
            time.sleep(0.1)

            if renderFuture_var.isValid:
                progress = renderFuture_var.progress

            print(progress)
            
            if renderFuture_var.isValid:
                renderState = renderFuture_var.renderState
        
        ui.messageBox('Render State:\n{}'.format( renderState ))
    
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

0 Likes
Message 8 of 10

charliex2
Advocate
Advocate

just to remove any beta software/arm hardware etc, i tried it one my older macs, which is all mainline

 

charliex2_0-1692471516586.png

 

0 Likes
Message 9 of 10

john.kirchner
Autodesk
Autodesk

Thank you for taking the time for testing this out. One of our engineers was also able to reproduce this on their Mac machine, I've logged a bug ticket for further investigation.



0 Likes
Message 10 of 10

charliex2
Advocate
Advocate

great, thanks john!

0 Likes