Message 1 of 5
CustomGraphicsMesh malfunctioning after Sep. Fusion 360 Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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):
And after the update, this code snippet could create a square but not with the correct vertex colors.
My product hash is 3f77c28c02b1b466e9d910ef562e48d42f47cc2b.
Is anyone experiencing similar issues?
Many thanks for your time.
Tan