CustomGraphicsMesh malfunctioning after Sep. Fusion 360 Update

CustomGraphicsMesh malfunctioning after Sep. Fusion 360 Update

Haowei.Tan
Explorer Explorer
699 Views
4 Replies
Message 1 of 5

CustomGraphicsMesh malfunctioning after Sep. Fusion 360 Update

Haowei.Tan
Explorer
Explorer

Hi All,

 

I have been using CustomGraphicsMesh with CustomGraphicsVertexColorEffect to create colorbar under Desing mode, and it worked quite well without any problem. However after the latest Sep. update, the CustomGraphicsMesh stopped to give the correct vertex color.

 

To reproduce this issue, please refer to the code below.

 

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

def run(context):
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        design = adsk.fusion.Design.cast(app.activeProduct)
        component = design.rootComponent
        group = component.customGraphicsGroups.add()

        coordinates = adsk.fusion.CustomGraphicsCoordinates.create([
            # upper left triangle
            -5, -5, 0,
            -5,  5, 0,
             5,  5, 0,

            # lower right triangle
            -5, -5, 0,
             5,  5, 0,
             5, -5, 0,
        ])
        coordinates.colors = [
            # royal
              0, 128, 255, 255,
              0, 128, 255, 255,
              0, 128, 255, 255,

            # orange
            255, 128,   0, 255,
            255, 128,   0, 255,
            255, 128,   0, 255,
        ]
        indices = [
            0, 1, 2,
            3, 4, 5,
        ]
        customMesh = group.addMesh(coordinates, indices, [0, 0, 1] * (coordinates.coordinateCount // 3), indices)
        customMesh.color = adsk.fusion.CustomGraphicsVertexColorEffect.create()
        
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

It should (and used to) display something as follows (this is something I created for demo purpose):

 

creation03.PNG

 

And after the update, this code snippet could create a square but not with the correct vertex colors.

 

creation01.PNGcreation02.PNG

 

My product hash is 3f77c28c02b1b466e9d910ef562e48d42f47cc2b.

 

Is anyone experiencing similar issues?

 

Many thanks for your time.

Tan

0 Likes
700 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor

I'm able to reproduce the problem and will see that a bug gets filed.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 5

Haowei.Tan
Explorer
Explorer

Hi Brian,

Thank you very much for your quick response! Looking forward to your further updates.

0 Likes
Message 4 of 5

Haowei.Tan
Explorer
Explorer

Hi Brian,

 

We are happy to confirm that in the latest Fusion360 major update this issue has been addressed and the bug is fixed now!

Thank you for your kind help!

 

Tan

0 Likes
Message 5 of 5

BrianEkins
Mentor
Mentor

That's great new. Thanks for letting me know.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes