Uh oh!
There was an error while loading. Please reload this page.
fix(import): geom default resolution, GLB normals, degenerate-transform guards - #77
Merged
Merged
Conversation
…llipsoid/sdf Typeless geoms default to sphere (MJCF's global default) instead of the base UMjGeom; primitives never bake a zero RelativeScale3D when size is class-inherited (new SyncEditorScaleFromSize, size resolved through the default-class chain without setting bOverride_size).
A zero or non-finite snapshot row applied via SetWorldLocationAndRotation NaN-floods the renderer (InverseFast NIL matrix in the distance-field pass) with nothing naming the offender. Skip the frame and warn once with the component name.
trimesh omits the NORMAL accessor unless include_normals is passed, and fix_normals needs networkx, which the dependency installer never listed. Missing networkx now fails the conversion (source-mesh fallback) instead of writing a normal-less GLB; failed/stale GLBs are removed and GLBs older than the script regenerate.
3 tasks
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 freeto 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.
Problem
Three related import/render defects, surfaced by issue #76 and by re-importing the G1:
typeattribute imports as the baseUMjGeom(no renderer) instead of MJCF's global default, sphere.plane,ellipsoidandsdfwere never mapped to their component classes. The G1's foot-contact geoms are all typeless.RelativeScale3Dfromsizewith a zero fallback, so a geom whose size is inherited from a<default>class bakes scale (0,0,0) into the Blueprint template. This is the source of theScale3D is (nearly) zerophysics warnings in [Bug] MjPDController attached to G1 articulation but robot remains fully unresponsive #76 and ofInverseFast NIL matrixrender spam once snapshot-driven transforms re-dirty the primitive every frame.clean_meshes.pyexported GLBs without a NORMAL accessor, andfix_normals()silently degraded when networkx was missing (networkx was never in the plugin's Python dependency list). Every mesh then imported withdegenerate tangent bases/nearly zero normals/Bad MeshDescription. Before the June 13 guard (b7a683b) the missing dep crashed the conversion, so imports fell back to the raw source mesh and looked clean, which is why this appeared to be a recent regression.Changes
<default>blocks, where forcing a type would clobber inheritance);plane/ellipsoid/sdfmapped;sizeresolved through the default-class chain for the editor visual whilebOverride_sizestays false so compile-time inheritance is untouched.SyncEditorScaleFromSize()on sphere/cylinder/capsule/box; never writes a non-positive scale.MjBody::ApplyRenderState,MjGeom::UpdateGlobalTransformandMjQuickConvertComponentskip zero/NaN snapshot rows and warn once naming the component, instead of flooding the renderer anonymously.include_normals=True; networkx added to the dependency check/install; a failed conversion removes its stale GLB (the importer prefers.glbover the source mesh); GLBs older than the script regenerate, so previously broken GLBs self-heal on the next import.Testing
3 new importer tests (typeless geom is a sphere, class-inherited size keeps a non-zero editor scale with no explicit override, plane maps to
UMjPlane). Verified live: G1 re-import produces noBad MeshDescriptionor zero-normal warnings and PIE runs withoutInverseFasterrors; the companion bridge fix (URLab-Sim/URLab_Bridge#3) was validated end to end against this branch with BeyondMimic on the G1.