@Big_G wrote:
Hi All,
Firstly, apologies for the lengthy post.
Can anyone please help me trouble shoot why the objects are not rendered correctly in the Viewport. See image below. The faces look dodgy, some are transparent and some not.
I have followed this example from @DavidRutten Custom Data Type : GH_GeometricGoo or GH_Goo ? . David coded up a Boat.cs example.
My understanding of the workflow and approach was:
public class Column
- (This is my Custom Object Class)
public class GH_Column : GH_GeometricGoo<Column>, IGH_PreviewData
- (Custom Class Goo wrapper)
public class ColumnParameter : GH_PersistentGeometryParam<GH_Column>, IGH_PreviewObject
- (Custom Class Parameter)
public class ColumnComponent : GH_Component
- (The Component)I have implemented the CastTo, CastFrom, DrawViewportMeshes, DrawViewportWires etc. Basically all requirements as per the absatract classes and Interfaces above.
All compiles well. The component work as intended. I have scrutinised the object. All good.
Code extract from GH_Column
public BoundingBox ClippingBox { get { return Boundingbox; } } public void DrawViewportMeshes(GH_PreviewMeshArgs args) { if (Value == null) { return; } if (Value.ColumnBrep != null) { args.Pipeline.DrawBrepShaded(Value.ColumnBrep, args.Material); } } public void DrawViewportWires(GH_PreviewWireArgs args) { if (Value == null) { return; } if (Value.ColumnBrep != null) { args.Pipeline.DrawBrepWires(Value.ColumnBrep, args.Color, -1); } }
Code Extract from ColumnParameter
public BoundingBox ClippingBox { get { return Preview_ComputeClippingBox(); } } public void DrawViewportMeshes(IGH_PreviewArgs args) { Preview_DrawMeshes(args); } public void DrawViewportWires(IGH_PreviewArgs args) { Preview_DrawWires(args); } public bool IsPreviewCapable { get { return true; } }
What is to go with the Preview Methods? Why is this not working? Is this a BoundingBox issue?
Happy to share code, just not sure what part as there is a lot of it.
Posts: 3
Participants: 2