Draft
Conversation
- Add comprehensive CLAUDE.md for future Claude Code instances - Update .gitignore to exclude .claude/ directory
Implemented full USD export functionality accessible via command-line arguments, including fixes for null data handling and invalid character sanitization. Changes: - ArgsHandler: Added OutputUSD property and -usd/-usda command-line flags - cgf-converter: Integrated UsdRenderer into export pipeline - UsdRenderer: Fixed null reference exceptions for optional mesh data (colors, UVs, normals) - UsdRenderer: Enhanced CleanPathString to sanitize all invalid USD prim name characters - UsdRenderer: Fixed material name consistency throughout serialization paths Fixes: - Materials with special characters (e.g., #) now properly sanitized to valid USD prim names - Optional mesh attributes only added when data exists, preventing crashes on simple geometry - Material paths use cleaned names consistently for proper reference resolution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolved Blender import warnings and properly implemented material parameters from MTL files in USD PBR format. Material Fixes: - UsdColor3f: Fixed color value syntax - use parentheses () for values, angle brackets <> for paths - UsdRenderer: Added full material property mapping (diffuse, specular, emissive, opacity, roughness, metallic) - UsdRenderer: Convert Shininess (0-128) to PBR roughness (inverted scale) - Default metallic to 0 for non-metallic surfaces Geometry Fixes: - GeomSubset indices: Convert vertex index ranges to face indices for elementType="face" Fixes "invalid indices" warning - face 0-11 instead of vertex indices [0,1,2,2,3,0,...] - Normal array sizing: Expand normals to faceVarying size by indexing with faceVertexIndices Fixes "Loop normal count mismatch" - 36 normals (one per loop) instead of 24 (one per vertex) Testing: - Added Box_Usd_WithMaterials integration test with comprehensive validation - Tests verify: material properties, color syntax, face indices, cleaned material names - Fast iteration cycle: 300ms test vs 30+ second publish/import workflow Documentation: - CLAUDE.md: Added TODO section for material improvements and renderer refactoring - CLAUDE.md: Documented renderer architecture options (partial classes vs composition) - CLAUDE.md: Marked geometry warnings as fixed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed multiple issues with texture processing in USD export that caused crashes when materials had textures or when -objectdir was not specified. Texture Fixes: - UsdRenderer: Added null check for texture.File before processing - UsdRenderer: Added null check for submat.Textures array - UsdRenderer: Removed dead code (unused textureName variable) - UsdRenderer: Fixed texture asset path - use actual file path instead of CleanPathString - UsdRenderer: Normalize texture paths to forward slashes for USD cross-platform compatibility - UsdRenderer: Handle null/empty DataDir when resolving texture paths Testing: - Updated HulaGirl_Usd_WithMaterials test to use auto-discovery instead of explicit matFile - Removed unnecessary matFile checks now that auto-discovery works with -objectdir - Both Box and HulaGirl tests pass with materials and textures The key insight: -objectdir is critical for both material auto-discovery AND texture resolution. When not specified, materials may fail to load and textures cannot be found. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Connect DDS texture alpha channels to Principled BSDF opacity input to enable transparency in USD materials. Adds UsdFloat attribute class and documents future need for shader-aware channel mapping. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add USD skeleton structure (SkelRoot, Skeleton prims) - Implement bindTransforms and restTransforms arrays - Add helper USD model classes (UsdSkeleton, UsdMatrix4dArray, etc.) - Add Matrix3x4.ConvertToUsdTransformMatrix() for proper matrix conversion - Improve USD matrix formatting (6 decimal places, round small values to 0) - Add integration test to verify skeleton export Note: Bone transforms still need work - matrices don't match expected values from Blender's USD import. Will continue investigation in next session. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Apply the glTF renderer's methodology for computing local bone transforms: - Start with BindPoseMatrix (worldToBone inverse bind matrix) - Multiply by inverse of parent's BindPoseMatrix to make relative to parent - Invert result to get local boneToParent transform - Transpose for USD row-major format Progress: - Bone positions are now correct (pelvis at 0.950612 in Z) - Rotations still need work - bones oriented incorrectly in Blender - Edit mode: spine goes along X (should be Z), Y is negated - Pose mode: bone heads in correct positions, tails scaled oddly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Adds comprehensive shader definition parsing and rule-based material generation for USD renderer. Parses CryEngine .ext shader files to understand StringGenMask flags and apply correct texture channel routing, preventing issues like unwanted transparency from naive alpha connections. Key features: - ShaderExtParser: Parses 40+ CryEngine .ext shader definition files - ShaderRulesEngine: Interprets StringGenMask flags (%ALPHAGLOW, %SPECULARPOW_GLOSSALPHA, etc.) and generates material rules - Refactored UsdRenderer into partial classes (Main, Materials, Geometry, Skeleton) following GltfRenderer pattern - Added support for Specular and Normal map textures with shader-aware channel routing - Fixed UsdFloat3f connection path handling (was creating invalid <<...>>) - Documented shader system architecture and implementation in CLAUDE.md Example: %ALPHAGLOW flag is now correctly detected and handled - prevents invalid float-to-color3f connections while respecting material properties. Tested with MWO adder cockpit model - correctly processes MechCockpit shader with proper material connections. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Two critical fixes for USD skeleton export: 1. **Fix invalid USD identifiers for numeric mesh names** - Apply CleanPathString() to UV and color primvar names - Prevents parse errors when mesh names start with digits (e.g., "50calnecklace_a") - USD identifiers cannot start with numbers; now prefixed with underscore 2. **Fix skinning data vertex mapping** - Use Ext2IntMap to properly map mesh vertices to skinning vertices - Ensures jointIndices and jointWeights arrays match mesh vertex count - Follows same approach as glTF renderer for correct vertex correspondence - Fixes "Joint weights of unexpected size" warning in Blender These fixes enable meshes with numeric names to import successfully with properly bound skeletons. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Three critical material rendering fixes: 1. **Fix roughness calculation** - Changed formula from (128 - shininess) / 128 to (255 - shininess) / 255 - Matches glTF renderer behavior - Fixes materials with high shininess values appearing incorrectly shiny - Now correctly handles full Cryengine shininess range (0-255) 2. **Add Nodraw shader support** - Detect materials with Shader="Nodraw" (used for proxy meshes) - Set opacity=0 to make them invisible in rendered output - Fixes proxy_bending and proxy_AI materials displaying when they shouldn't 3. **Fix Opacity texture handling** - Research shows Cryengine Opacity maps are for translucency/backlighting, not alpha cutout - Alpha cutout uses diffuse texture alpha channel + AlphaTest parameter - USD PreviewSurface doesn't support translucency effects - Now: Only use Opacity map if no diffuse texture exists (fallback) - Default: Use diffuse alpha for transparency (correct for vegetation materials) - Prevents conflict where both diffuse alpha and opacity map try to control same input Technical details: - Opacity maps in Cryengine define foliage thickness for light transmission - Used with %LEAVES shader flag for backlighting effects - USD has no equivalent, so we prioritize diffuse alpha for cutout transparency References: - Cryengine Vegetation Shader docs - glTF renderer roughness formula 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implement full Star Citizen Ivo format geometry export in UsdRenderer: - Fix node hierarchy to use _cryData.Nodes for Ivo compatibility - Replace model-specific validation with direct geometry checks - Add VertUV extraction with bounding box decompression - Handle optional ScalingVectors for .cga/.cgf files - Extract vertices, UVs, and colors from combined VertUV structures - Add comprehensive Teapot_Ivo_USD test with 11 assertion groups validating document structure, materials, geometry attributes, and GeomSubsets 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Extract only per-subset vertices instead of entire geometry array - Remap indices from global to local (matching Collada/glTF approach) - Add cycle detection to BuildJointPaths to prevent stack overflow - Add ToString() override to UsdToken for better test assertions - Update tests and document known issue with node transforms 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- New test class runs from VS Test Explorer without publish/command-line
- Outputs files directly to source asset directories for quick testing
- Includes helper methods: RenderToUsd(), RenderToCollada(), RenderToGltf()
- Excluded from CI via [TestCategory("manual")]
- Updated CLAUDE.md with documentation and transform investigation notes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Only add SkelBindingAPI to meshes that have actual vertex skinning data (IntVertices or BoneMappings). Previously, SkelBindingAPI was added to all meshes when CompiledBones existed, causing non-skinned parts like vehicle components to use skeleton transforms instead of Xform transforms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Use per-node BoundingBoxMin/Max from NodeMeshCombo instead of global geometry bounds for the extent property in USD export - Add FormatMatrixValue to UsdMatrix4d to prevent scientific notation (e.g., 2.9802322E-08) and round tiny values to zero 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- bindTransforms: Invert BindPoseMatrix to get boneToWorld (USD expects world-space transforms, CryEngine stores worldToBone) - restTransforms: Compute proper local transforms relative to parent using parentWorldToBone * childBoneToWorld - Remove unused MoveTranslationToRow4 helper method - Transpose matrices to convert from column-major to row-major for USD Bones now point in the correct direction (-Z for hanging pendant) and armature manipulation works correctly in Blender. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add UsdSkelAnimation prim and time-sampled attribute types for translations/rotations - Create UsdRenderer.Animation.cs partial class for animation export - Load animations from .dba files referenced in .chrparams - Fix .chrparams path resolution (relative to input file directory) - Fix $TracksDatabase lookup priority over #filepath - Add debug logging for animation loading troubleshooting - Update CLAUDE.md with animation support documentation and .caf TODO 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Use frame numbers instead of seconds for time samples - Add startTimeCode, endTimeCode, timeCodesPerSecond to USD header - Add scales array (required by USD SkelAnimation spec for validity) - Pass header to CreateAnimations for timeline metadata Animation still not playing in Blender - needs further investigation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Use half3[] for scales instead of float3[] (required by USD spec) - Add UsdTimeSampledHalf3Array class for half-precision scale data - Fix number formatting to use fixed-point notation instead of scientific notation (e.g., 0.000001 instead of 1E-06) - Use integer formatting for frame numbers in time samples This fixes animation playback in Blender - animations now work! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
USD is now the default export format, reflecting its status as the industry standard interchange format with broad support in Blender, Maya, Houdini, Unreal Engine, Unity, and other 3D applications. Collada, glTF, and other formats remain available via command-line flags. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…tial classes - Implement matrix-based animation export for Collada (.dae) files - Animation data from .dba files now exports with proper bone channel targeting - Split ColladaModelRenderer (1691 lines) into 7 partial class files: - Animation.cs: Animation export with keyframe sampling - Materials.cs: Material/texture creation - Geometry.cs: Mesh processing - Skeleton.cs: Controller/bone/skinning - Nodes.cs: Visual scene hierarchy - Utilities.cs: String formatting helpers - Fix bone name consistency for animation channel targeting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add UVs2 property to GeometryInfo for second UV layer
- USD renderer outputs primvars:{nodeName}_UV2 when second UV is available
- Update CLAUDE.md with multi-UV documentation and implementation status
- Document CryEngine vertex formats supporting dual UVs (parsing TBD)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Blender's Collada importer cannot import matrix-based animations, requiring decomposed transforms (translate/rotate/scale) instead. Changes: - Joint nodes now use decomposed transforms with proper SIDs: - <translate sid="location"> - <rotate sid="rotationZ/Y/X"> - <scale sid="scale"> - Animation channels now target decomposed components: - location.X, location.Y, location.Z - rotationX.ANGLE, rotationY.ANGLE, rotationZ.ANGLE - Added QuaternionToEulerDegrees() for rotation conversion Status: Still WIP - Blender import shows reduced "removed unused curves" (13k vs 42k) but animations still not appearing in Action Editor. Further investigation needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…ibility - Changed joint nodes from decomposed transforms to <matrix sid="transform"> - Changed animation output from component floats to float4x4 matrices - Changed channel targets from BoneName/location.X to BoneName/transform - Removed library_animation_clips (Blender doesn't use it) Still WIP: Blender reports "removed 42320 unused curves" and animations don't appear in Action Editor. Need to investigate further differences with Blender's glTF→Collada export. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The Collada spec requires elements within <animation> to be in a specific order: asset, animation, source, sampler, channel, extra. Our export had <channel> before <source> and <sampler>, which caused Blender's importer to fail with "removed N unused curves" because the channel references the sampler before it was defined. Fixed by reordering properties in ColladaAnimation.cs. XmlSerializer outputs elements in declaration order, so the fix is simply reordering the property declarations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Document both root causes of Blender animation import failure: 1. Wrong SID (matrix vs transform) 2. Wrong element order (channel before source/sampler) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…kflow (#223) Blender's USD importer only reads the single animation bound via skel:animationSource, ignoring any other SkelAnimation prims in the file. This is a limitation of both UsdSkel (single-target relationship) and Blender's importer implementation. Changes: - When 2+ animations exist, export each to separate file (model_anim_*.usda) - Each animation file contains skeleton + single bound animation - Main file (model.usda) contains skeleton + mesh only (no animation) - Single animation models still include animation in main file Workflow in Blender: 1. Import main file (skeleton + mesh) 2. Import animation files (each creates temp armature with Action) 3. Assign Actions to main armature in Action Editor 4. Delete temp armatures, use NLA to sequence Also adds research documentation on USD/Blender animation architecture. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
* Add CAF animation file support for USD export Implements support for individual .caf animation files (vs .dba databases): - ChunkController_829: Complete implementation for compressed format (was stub) - ChunkController_830: Uncompressed CryKeyPQLog format (28 bytes/keyframe) - ChunkController_831: Compressed format with separate rotation/position tracks - CafAnimation model class for aggregated animation data - Wildcard pattern expansion for chrparams (*.caf, cinematics/*.caf) - USD SkelAnimation generation from CAF bone tracks CAF files use logarithmic quaternion encoding for rotations, which is converted to standard quaternions during parsing. Controller IDs are CRC32 hashes of bone names for skeleton matching. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix CAF controller chunk parsing and quaternion decompression ChunkController_829/831 fixes: - Correct data layout: rotation values -> times -> position values -> times - Fix time format enum: 0=float, 1=uint16, 2=byte (was inverted) - Add alignment between data sections when TracksAligned is set - Handle PositionKeysInfo: if 0, position shares rotation's time keys - Remove non-existent Flags field from 829 (14-byte header, not 18) SmallTree quaternion decompression fix: - Clamp sqrt input to prevent NaN when sqrsumm > 1.0 due to precision issues - Applied to all 4 SmallTree quaternion types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add test * 829 controller caf animation (WIP) * Add Star Citizen #ivo CAF animation chunk support Implements parsing for Star Citizen's #ivo animation format: - New chunk types: IvoCAFData (0xA9496CB5), IvoAnimInfo (0x4733C6ED), IvoDBAData (0x194FBC50), IvoDBAMetadata (0xF7351608) - ChunkIvoCAF_900 parses #caf blocks with bone controllers and compressed keyframe data (SmallTree48/64BitQuat formats) - Fixed wildcard path expansion in chrparams to handle patterns like "*/*.caf" for recursive subdirectory searches - Added chunk factory registrations for new #ivo animation types - Integration tests for aloprat creature model with CAF animations The aloprat skeleton now exports with 9 separate animation USDA files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix CAF animation time key normalization Raw uint16 time keys were being used directly as frame numbers, causing animations to have 60000+ frames. Now normalizes time keys to frame indices (0 to keyframe count-1). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add bounds checking for material and normals array access in USD renderer Fixes IndexOutOfRangeException when converting Star Citizen .skin files (e.g., aloprat.skin) where MatID could exceed SubMaterials array length. Also adds bounds checking for normals array access to prevent crashes when indices reference out-of-bounds normal data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Document USD skinning bone mapping issue for Star Citizen .skin files Bones influence wrong vertices (e.g., R_UpperArm affects head vertices). Added investigation notes for future debugging session. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix USD skinning bone-to-vertex mapping for Star Citizen .skin files The bone indices in CryEngine skinning data (IntSkinVertex.BoneMapping.BoneIndex) are indices into the CompiledBones array, but USD's skel:jointIndices expects indices into the joints array built from jointPaths. Since BuildJointPaths() walks the bone hierarchy depth-first, it produces a different ordering than the linear CompiledBones array. Added _compiledBoneIndexToJointIndex mapping in CreateSkeleton() and use it in AddSkinningAttributes() to remap bone indices before outputting to USD. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix material ID lookup for Ivo nodes with more nodes than mesh subsets The MaterialIndices array has NumberOfMeshSubsets entries (one per mesh subset), not NumberOfNodes entries. Using materialTable[index] where index is a node index caused ArgumentOutOfRangeException when NumberOfNodes > NumberOfMeshSubsets. Fixed by getting the material ID directly from the mesh subset (subsets[0].MatID) when the node has geometry, which is the correct source for this data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix duplicate material prims in USD export When a material file has submaterials with the same name (after cleaning), USD import would fail with "Duplicate prim" error. Added deduplication by tracking created material names and skipping duplicates. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add Normalmap texture type mapping MTL files can use Map="Normalmap" for normal maps, but the parser only handled "Bumpmap" and "Normal". Added "Normalmap" as an alias. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add manual tests * Add null check for SubMaterials in USD material creation Some materials may have null SubMaterials array. Skip these gracefully instead of throwing NullReferenceException. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix duplicate GeomSubset prims in USD export Multiple mesh subsets can use the same material, creating duplicate GeomSubset prims with the same name. Now collect and merge face indices per material, creating one GeomSubset per unique material. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Move ManualRenderTests to separate ManualTests namespace Reorganize test structure so manual tests can be excluded when running unit and integration tests from Test Explorer. The ManualTests namespace allows selective test execution without needing test.runsettings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add ChunkIvoDBAMetadata version 901 support Star Citizen 4.1 uses version 901 of the IvoDBAMetadata chunk. Format is identical to version 900. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add ChunkIvoDBAMetadata version 901 support with debug logging Star Citizen 4.1 uses version 901 of the IvoDBAMetadata chunk. Key difference from v900: string table starts 4 bytes earlier, overlapping with the last entry's Padding field. Added debug logging to manual tests to help diagnose chunk parsing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix glTF coordinate system to match USD/Blender orientation Updated all axis transformation functions to use consistent mapping: CryEngine (X, Y, Z) → glTF (X, Z, -Y) This ensures glTF models face +Y in Blender after import, matching USD exports. The fix includes: - SwapAxesForPosition: (x, y, z) → (x, z, -y) - SwapAxesForTangent/Quaternions: consistent axis transformation - SwapAxes(Matrix4x4): correct T × M × T⁻¹ conjugation - Use matrix-based node transforms instead of TRS decomposition - Add per-subset vertex extraction for Ivo format skinning 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add additive animation support for CAF and DBA exports Additive animations store bone transforms as deltas from the rest pose, not absolute positions. When exported directly, Blender collapses the skeleton because all translations are near-zero. Changes: - Add IsAdditive property to CafAnimation class - Read CA_ASSET_ADDITIVE flag (0x001) from ChunkGlobalAnimationHeaderCAF - Check AssetFlags.Additive in DBA MotionParams - Convert additive deltas to absolute transforms during USD export: - absolute_rotation = restRotation * additiveRotation - absolute_translation = restTranslation + additiveTranslation - Add BuildRestRotationMapping() for additive conversion Fixes pilot joystick/throttle animations that were previously broken. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update claude * Fix 0x801 compiled bones matrix interpretation for ArcheAge models Version 0x801 stores only B2W (boneToWorld) matrix, not W2B like assumed. The fix computes W2B by inverting B2W, matching the Lumberyard loader behavior. This corrects armature alignment issues for ArcheAge .chr files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix USD animation rest pose translation extraction CryEngine matrices store translation in column 4 (M14, M24, M34), not row 4. BuildRestTranslationMapping was using .Translation which reads M41/M42/M43, returning zeros for all bones. This broke CAF animations and additive DBA animations that rely on rest pose translations. Additionally, CAF position data is absolute local transforms, not deltas. The code was incorrectly adding rest translation to animation positions, causing characters to float/levitate during animation. Changes: - Fix translation extraction to use M14/M24/M34 in BuildRestTranslationMapping - Fix CAF position handling: use animation data directly, not rest + delta - Add separate RotationKeyTimes/PositionKeyTimes to BoneTrack for 829 controllers - Add validation warnings to unvetted chunks (900, 901, 829) - Fix ChunkController_829 header padding alignment - Document animation data flow in DEVNOTES.md for future chunk implementations Tested with MWO pilot (800+905) and Armored Warfare chicken (901+829). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Mark ChunkController_829 as vetted Armored Warfare chicken walk/idle animations confirmed working in Blender. Updated DEVNOTES.md vetted chunks table and removed warning from chunk class. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add USD integration tests for Armored Warfare chicken - Add Chicken_Usd test for skeleton/armature validation - Verifies 15 joints with correct hierarchy - Checks bindTransforms, restTransforms, and mesh skinning - Add Chicken_WalkAnimation_Usd test for CAF animation export - Tests ChunkController_829 animation pipeline - Regression test for pelvis translation (prevents levitation bug) - Validates timeSamples, frame range, and joint count 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Mark ArcheAge animations as vetted in DEVNOTES - Add ArcheAge to working animations list (uses ChunkCompiledBones_801 + .cal) - Add ChunkCompiledBones_801 to vetted chunks table - Update status to include MWO, Armored Warfare, and ArcheAge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add DBA in-place streaming mode support for KCD2 animations ChunkController_905 now correctly handles two DBA storage modes: - Standard mode: positive offsets relative to start of track data - In-place streaming mode: negative offsets relative to END of track data Key fixes: - Detect in-place streaming via negative offset in keyTimeOffsets[0] - Handle different data layout: padding -> animations -> controllers -> track data - Add 4-byte alignment before track data in in-place mode - Use rest translation for bones without position animation (fixes collapsed skeleton) Also adds DBA wildcard pattern resolution (*.dba) in chrparams. Tested with KCD2 pig skeleton (51 animations) and MWO pilot. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Process .cal animation definition files * Update documentation with animation support details - Add Animation Support section to CLAUDE.md covering DBA, CAF, and CAL formats - Document critical implementation details (matrix convention, rest translation, additive) - Add Star Citizen #ivo animations as next development target in DEVNOTES.md - Minor code style cleanup in CalFile.cs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add CAF animation support and fixes to glTF renderer - Add CAF/CAL animation export to glTF (WriteCafAnimations method) - Fix split DDS texture paths (.dds.1 → .dds.dds bug) - Add -ut unsplit texture support for glTF - Fix NoDraw materials not being added to materials array CAF animations from .caf files and .cal animation lists are now exported to glTF alongside existing DBA animation support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Gltf updates (WIP) * Add simple bone map datastream support (0x9D51C5EE) - Rename IVOUNKNOWN to IVOSIMPLEBONEMAP in DatastreamType enum - Parse single-bone skinning data for rigid attachment meshes - Each vertex has ushort bone index, weight implied 1.0 - Used by weapon attachments, magazines, and other rigid parts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Animation work (WIP) * Fix UTF-8 decoding error when reading bone names (#226) Replace BinaryReader.ReadChar() with ReadByte() in GetNullSeparatedStrings to fix "output char buffer is too small" exception. ReadChar() with UTF-8 encoding fails on certain byte sequences. Changes: - Add bounded overload that uses string table size to prevent buffer overrun - Update ChunkCompiledBones_901 to use string table size instead of discarding it - Update ChunkNodeMeshCombo_900 to use bounded version - Add unit tests for GetNullSeparatedStrings Fixes #226 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Refactor Ivo animations (WIP) * Collada animation improvements and separate file export - Fix matrix translation convention: use M14/M24/M34 (column 4) instead of M41/M42/M43 (row 4) to match CryEngine/Collada convention - Add rest pose fallback for bones without position/rotation tracks - Export each animation to separate .dae file for Blender compatibility (Blender merges all animations into one action, ignores animation_clip) - Remove animations from main geometry file (only in separate anim files) - Add turret manual tests for Collada and USD - Document Blender Collada animation import limitations in DEVNOTES.md Note: Animations still have translation/rotation issues to investigate. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add devnotes to sln. Update integration tests * Add turret gltf test * Fix Ivo format skeletal animation and bone mapping Bone hierarchy fixes: - Fix ChunkCompiledBones_901 to use ParentControllerIndex instead of OffsetParent for building bone parent-child relationships - Remap IVOSIMPLEBONEMAP indices from NodeMeshCombo to CompiledBone indices using ObjectNodeIndex property Renderer improvements: - Enable skinning for all file types with skinning data (not just .chr/.skin extensions) - Add CompiledBones_Ivo to bone chunk detection in Model.cs and Collada - USD: Place mesh hierarchy under Skeleton prim for proper Blender object parenting (geometry follows armature in object mode) - USD: Merge Xform+Mesh into single Mesh prim with transforms, reducing unnecessary nesting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * glTF: Attach meshes to skeleton nodes for Ivo format For Ivo format files with ObjectNodeIndex mappings, create a unified hierarchy where meshes are attached directly to skeleton bone nodes instead of creating separate parallel geometry/skeleton hierarchies. This ensures geometry moves with the skeleton when animated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * glTF: Fix Ivo format detection and improve hierarchy - Initialize ObjectNodeIndex to -1 (not set) instead of 0 This prevents traditional .chr files from being incorrectly treated as Ivo format, which caused random geometry to be attached to bone nodes - Use single shared skin named after model (not "barrel/skin") - Unified skeleton/mesh hierarchy for Ivo format files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add Ivo DBA animation support to USD renderer - Fix DBA path resolution: resolve relative paths against ObjectDir - Add Ivo DBA animation extraction (ChunkIvoDBAData/ChunkIvoDBAMetadata) - Support Ivo DBA in both CreateAnimations() and ExportAnimationFiles() - Add SampleIvoPosition/SampleIvoRotation for keyframe interpolation Ivo format DBA files use different chunk types than standard DBA files. The chrparams binary XML loading was working, but the DBA path wasn't being resolved and the renderer didn't know how to extract animations from Ivo DBA chunks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * USD: Fix double transform for Ivo format skinned meshes Add CreateIvoSkeletonNodes() method that builds the skeleton bone Xform hierarchy first, then attaches meshes directly to their corresponding bones with identity transforms. Previously, meshes were nested in a node hierarchy (barrel inside body), causing double transforms: once from scene graph parenting and once from skeletal skinning. The barrel appeared at doubled position in Blender's pose/object mode. Now for Ivo format with skinning: - Bone Xforms form the hierarchy (matching skeleton joints) - Meshes are direct children of their corresponding bone Xforms - Mesh transforms are identity (all positioning via skeletal skinning) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix USD mesh placement for skeletal animation Place skinned meshes at SkelRoot level (siblings of Skeleton) instead of under bone Xforms. This avoids double-transforms where meshes would inherit bone Xform transforms via scene graph parenting in addition to skeletal skinning transforms. Meshes now have identity transforms with all positioning coming purely from skeletal skinning (skel:jointIndices/Weights). Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add ivo animations to gltf exports (WIP) * Normals work (WIP) * Fix Ivo DBA animation parsing and position handling - Fix DBA block parsing: next block starts after controller headers, not at blockEnd (was only finding 1 of N animation blocks) - Ivo DBA positions use rest + delta (confirmed working with lasercannon) - Ivo DBA rotations use rest * delta (WIP, needs rotation-only test case) - Add metadata StartPosition/StartRotation access for future use - Add diagnostic logging for animation values - Update glTF animation handling to match USD approach Rotation handling still needs validation with a rotation-only animation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Animation work for SC (WIP) * Add motion params 925 chunk. cleanup. * Animation work * Add Claude Code chunk-guide skill Adds a skill documenting how to add new chunk types/versions to the converter. Updates .gitignore to track skills while ignoring local settings. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude <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.
Draft PR for v2.0