Andy/rh 95837/rdk warnings - #135
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.