Skip to content

Andy/rh 95837/rdk warnings - #135

Merged
andylebihan merged 3 commits into
9from
andy/RH-95837/rdk-warnings
Jun 22, 2026
Merged

Andy/rh 95837/rdk warnings#135
andylebihan merged 3 commits into
9from
andy/RH-95837/rdk-warnings

Conversation

@andylebihan

Copy link
Copy Markdown
Member

No description provided.

andylebihan and others added 3 commits June 17, 2026 18:56
SamplesCs.sln now builds with 0 warnings / 0 errors on all target
frameworks. Migrated the RDK samples to their Rhino 9 replacements:

- RenderMaterial.SimulateMaterial(ref Material, bool) ->
  SimulateMaterial(ref Material, RenderTexture.TextureGeneration) in
  CustomMaterial, CustomEtoUiSectionMaterial and SampleRdkMaterial.
- ContentCollectionIterator.DeleteThis() -> Dispose().
- RhinoDoc.CurrentEnvironment -> RenderSettings.SetRenderEnvironment().
- Fixed CS8073 in CustomMaterialViewModel: the "varies" check compared a
  non-nullable Color to null (always false); use VariesColor instead.
- Annotated the COM-automation console sample with
  [SupportedOSPlatform("windows")] to clear CA1416.

CustomRenderMeshProvider2/RenderPrimitiveList (TestCustomMeshProvider) and
the obsolete SubNodeControl in the WinForms designer require a larger,
runtime-verified port to the new CustomRenderMeshes.RenderMeshProvider API
and a replacement control. Their warnings are suppressed with documented
TODO (RH-95837) pragmas and tracked as follow-up work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ntrol

Port TestCustomMeshProvider from the obsolete CustomRenderMeshProvider2 /
RenderPrimitiveList to the Rhino 9 Rhino.Render.CustomRenderMeshes.
RenderMeshProvider API:

- Override HasCustomRenderMeshes / RenderMeshes (returning a RenderMeshes
  collection of Instance objects) instead of WillBuildCustomMeshes /
  BuildCustomMeshes / BoundingBox.
- Use the non-obsolete 5-arg RenderMeshes ctor and fold the source sphere
  into the running hash so the RDK rebuilds meshes when the object changes
  (replaces the old ReplaceRhinoObject / ObjectChanged cache invalidation).
- Give the provider a stable [Guid] so ProviderId (GetType().GUID) is fixed.
- Register via RenderMeshProvider.RegisterProviders(this).

SubNodeControl (RhinoWindows.Forms.Controls.Render.SubNodeControl) is
obsolete in Rhino 9 with no replacement yet, so it is disabled (commented
out) in CustomMaterialUserInterfaceSection rather than suppressed. A
replacement is tracked as a separate RDK bug.

SamplesCs.sln builds with 0 warnings / 0 errors on all target frameworks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two fixes from testing the ported provider in Rhino 9:

- Register the provider with the explicit RenderMeshProvider.RegisterProvider
  (instance) overload instead of the assembly-scan RegisterProviders, so
  registration does not depend on RDK plug-in lookup timing during OnLoad.
  Without this the provider was never registered.

- Always supply a valid material for the custom render mesh instance. Honoring
  the ReturnNullForStandardMaterial flag (returning a null material to mean
  "use the object's standard material") currently leaves the custom render
  meshes unshaded (wireframe) in shaded display - both the per-object and
  non-object CRM display paths fail to substitute a material for the null.
  Until that core issue is fixed (RH-96417), the sample resolves and supplies
  obj.RenderMaterial (or a basic material) regardless of the flag.

Verified in Rhino 9: the sphere appears and shades with the plug-in loaded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@andylebihan
andylebihan merged commit e37d261 into 9 Jun 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant