Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CustomGraphicsMesh malfunctioning after Sep. Fusion 360 Update

4 REPLIES 4
Reply
Message 1 of 5
Haowei.Tan
264 Views, 4 Replies

CustomGraphicsMesh malfunctioning after Sep. Fusion 360 Update

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

4 REPLIES 4
Message 2 of 5
BrianEkins
in reply to: Haowei.Tan

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
in reply to: Haowei.Tan

Hi Brian,

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

Message 4 of 5
Haowei.Tan
in reply to: BrianEkins

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

Message 5 of 5
BrianEkins
in reply to: Haowei.Tan

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

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report