Skip to content

Fix missing textures#113

Merged
vnoves merged 6 commits intodevelopfrom
FixMissingTextures
Jul 10, 2025
Merged

Fix missing textures#113
vnoves merged 6 commits intodevelopfrom
FixMissingTextures

Conversation

@vnoves
Copy link
Member

@vnoves vnoves commented Jul 10, 2025

Summary by CodeRabbit

  • New Features

    • Added support for tint color and fade effects in material textures during export.
    • Enhanced material texture handling to include advanced texture properties such as scaling, rotation, and opacity.
  • Refactor

    • Streamlined material texture processing for better maintainability and extensibility.
    • Updated internal build process to use user-specific application data directories for plugin deployment.
    • Separated material color setting logic to improve handling of base color with and without embedded textures.
    • Simplified UV coordinate handling by removing legacy UV mapping methods and integrating direct UV assignment.

@coderabbitai
Copy link

coderabbitai bot commented Jul 10, 2025

Walkthrough

This update removes custom UV mapping logic and associated source files, centralizing texture property handling in a new MaterialTextures class. Material export now delegates texture setup, including tint and fade, to this class. The image blending utility and material data structures are updated to support tinting. Build scripts are modified to use user-specific application data paths.

Changes

Files/Groups Change Summary
Common_glTF_Exporter/UVs/CylindricalUv.cs
Common_glTF_Exporter/UVs/PlanarUv.cs
Common_glTF_Exporter/UVs/VertexUvs.cs
Deleted all UV mapping helper classes and their methods.
Common_glTF_Exporter/Common_glTF_Exporter.projitems Removed UV mapping files from compilation; added MaterialTextures.cs.
Common_glTF_Exporter/Materials/MaterialTextures.cs Introduced new static class for setting material texture properties during export.
Common_glTF_Exporter/Materials/AssetProperties.cs Switched to strongly-typed property names; added methods for tint and fade extraction.
Common_glTF_Exporter/Materials/BitmapsUtils.cs Updated image blending method to support tint color blending.
Common_glTF_Exporter/Core/GLTFMaterial.cs Added a TintColour property to the GLTFMaterial class.
Common_glTF_Exporter/Core/GlTFExportContext.cs Refactored UV assignment to directly use polymesh UVs with material and preference checks.
Common_glTF_Exporter/Materials/RevitMaterials.cs Delegated material texture setup to MaterialTextures.SetMaterialTextures; removed inline logic.
Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs Passed TintColour to the image blending utility for export.
Common_glTF_Exporter/Materials/MaterialProperties.cs Separated base color setting into a new method that conditionally sets color based on texture presence.
Revit_glTF_Exporter_2019/2020/2021/2022/2023/2024.csproj Changed post-build copy targets from ALLUSERSPROFILE to APPDATA (user-specific application data).

Sequence Diagram(s)

sequenceDiagram
    participant RevitMaterials
    participant MaterialTextures
    participant AssetPropertiesUtils
    participant GLTFMaterial

    RevitMaterials->>MaterialTextures: SetMaterialTextures(material, gl_mat, doc, opacity)
    MaterialTextures->>AssetPropertiesUtils: GetTexturePath(asset)
    MaterialTextures->>AssetPropertiesUtils: GetScale(asset)
    MaterialTextures->>AssetPropertiesUtils: GetRotationRadians(asset)
    MaterialTextures->>AssetPropertiesUtils: GetTint(asset)
    MaterialTextures->>AssetPropertiesUtils: GetFade(asset)
    MaterialTextures->>GLTFMaterial: Set texture properties (embed, scale, rotation, tint, fade, etc.)
Loading

Possibly related PRs

  • #100: Adds new texture-related classes and properties, related to texture export but not overlapping with this PR’s MaterialTextures class.

Poem

A bunny with code on its mind,
Hopped past the UVs left behind.
With tints and fades, and textures anew,
The exporter’s job is streamlined too!
Now in your AppData, not ALLUSERS’ den,
This rabbit’s work is neat again.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (5)
Revit_glTF_Exporter_2021/Revit_glTF_Exporter_2021.csproj (1)

95-100: Prefer xcopy /Y /I /Q (or robocopy) over bare copy for wildcard directory copies.

copy treats the destination as a filename; with * sources it can prompt or fail.
xcopy (or robocopy) handles directories, preserves attributes, and suppresses prompts with flags:

-copy "$(ProjectDir)$(OutputPath)\Images\*" "$(APPDATA)\Autodesk\ApplicationPlugins\leia.bundle\Contents\2021\Images\"
+xcopy "$(ProjectDir)$(OutputPath)\Images\*" "$(APPDATA)\Autodesk\ApplicationPlugins\leia.bundle\Contents\2021\Images\" /Y /I /Q

Replicate the switch for the remaining copy commands to make the post-build step idempotent and CI-friendly.

Common_glTF_Exporter/Materials/RevitMaterials.cs (1)

10-13: Remove unused imports.

The added imports System.IO.Ports, System.Windows.Controls, and System.Windows.Media.Media3D don't appear to be used in this file.

-using System.IO.Ports;
-using System.Windows.Controls;
-using System.Windows.Media.Media3D;
Common_glTF_Exporter/Materials/MaterialTextures.cs (2)

10-12: Remove unused imports to improve code clarity.

The following imports appear to be unused in this file:

  • System.IO.Ports (line 10)
  • System.Windows.Controls (line 11)
  • System.Windows.Media.Media3D (line 12)
-using System.IO.Ports;
-using System.Windows.Controls;
-using System.Windows.Media.Media3D;

20-21: Consider improving method parameter formatting for better readability.

The method signature spans multiple lines inconsistently. Consider aligning the parameters properly.

-        public static GLTFMaterial SetMaterialTextures(Material material, GLTFMaterial gl_mat,
-    Document doc, float opacity)
+        public static GLTFMaterial SetMaterialTextures(Material material, GLTFMaterial gl_mat,
+            Document doc, float opacity)
Revit_glTF_Exporter_2024/Revit_glTF_Exporter_2024.csproj (1)

87-100: Post-build script duplication across versions – move to a shared target

Nearly identical post-build blocks now exist in every yearly project file (2019-2024). Centralising them in an MSBuild .targets/shared props file (or invoking a single PowerShell/batch script) will eliminate copy-paste drift and ease future path updates (e.g. next Revit version).

Small upfront refactor; big long-term maintenance win.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91dd261 and 4ba1cd5.

📒 Files selected for processing (17)
  • Common_glTF_Exporter/Common_glTF_Exporter.projitems (1 hunks)
  • Common_glTF_Exporter/Core/GLTFMaterial.cs (1 hunks)
  • Common_glTF_Exporter/Core/GlTFExportContext.cs (2 hunks)
  • Common_glTF_Exporter/Materials/AssetProperties.cs (6 hunks)
  • Common_glTF_Exporter/Materials/BitmapsUtils.cs (1 hunks)
  • Common_glTF_Exporter/Materials/MaterialTextures.cs (1 hunks)
  • Common_glTF_Exporter/Materials/RevitMaterials.cs (2 hunks)
  • Common_glTF_Exporter/UVs/CylindricalUv.cs (0 hunks)
  • Common_glTF_Exporter/UVs/PlanarUv.cs (0 hunks)
  • Common_glTF_Exporter/UVs/VertexUvs.cs (0 hunks)
  • Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs (1 hunks)
  • Revit_glTF_Exporter_2019/Revit_glTF_Exporter_2019.csproj (1 hunks)
  • Revit_glTF_Exporter_2020/Revit_glTF_Exporter_2020.csproj (1 hunks)
  • Revit_glTF_Exporter_2021/Revit_glTF_Exporter_2021.csproj (1 hunks)
  • Revit_glTF_Exporter_2022/Revit_glTF_Exporter_2022.csproj (1 hunks)
  • Revit_glTF_Exporter_2023/Revit_glTF_Exporter_2023.csproj (1 hunks)
  • Revit_glTF_Exporter_2024/Revit_glTF_Exporter_2024.csproj (1 hunks)
💤 Files with no reviewable changes (3)
  • Common_glTF_Exporter/UVs/PlanarUv.cs
  • Common_glTF_Exporter/UVs/CylindricalUv.cs
  • Common_glTF_Exporter/UVs/VertexUvs.cs
🧰 Additional context used
🧬 Code Graph Analysis (4)
Common_glTF_Exporter/Core/GLTFMaterial.cs (1)
Common_glTF_Exporter/Materials/AssetProperties.cs (2)
  • Autodesk (61-78)
  • Autodesk (113-139)
Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs (1)
Common_glTF_Exporter/Materials/BitmapsUtils.cs (2)
  • BitmapsUtils (11-138)
  • BlendImageWithColor (32-116)
Common_glTF_Exporter/Materials/MaterialTextures.cs (4)
Common_glTF_Exporter/Materials/AssetProperties.cs (8)
  • Autodesk (61-78)
  • Autodesk (113-139)
  • Asset (20-34)
  • AssetPropertiesUtils (9-152)
  • GetTexturePath (36-59)
  • GetScale (93-111)
  • GetRotationRadians (80-91)
  • GetFade (141-151)
Common_glTF_Exporter/Core/GLTFMaterial.cs (1)
  • GLTFMaterial (14-44)
Common_glTF_Exporter/Materials/RevitMaterials.cs (1)
  • GLTFMaterial (30-69)
Common_glTF_Exporter/Core/GLTFTextureInfo.cs (3)
  • GLTFTextureInfo (16-23)
  • GLTFTextureExtensions (33-37)
  • GLTFTextureTransform (25-31)
Common_glTF_Exporter/Materials/BitmapsUtils.cs (2)
Common_glTF_Exporter/Materials/AssetProperties.cs (2)
  • Autodesk (61-78)
  • Autodesk (113-139)
Common_glTF_Exporter/Materials/MaterialProperties.cs (1)
  • SrgbToLinear (39-44)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (23)
Revit_glTF_Exporter_2023/Revit_glTF_Exporter_2023.csproj (1)

97-99: Validate per-user deployment strategy

Switching from $(ALLUSERSPROFILE) to $(APPDATA) moves the bundle from a machine-wide to a per-user location.
Revit will load add-ins from either path, so leaving an old copy under ProgramData (“All Users”) can result in duplicate plug-ins or stale resources being preferred over the fresh ones.

Consider adding an explicit clean-up step (or at least documenting the manual action) that removes the legacy …\ProgramData\Autodesk\ApplicationPlugins\leia.bundle folder on developer / CI machines.
This prevents “ghost” copies that may still reference the missing-texture layout you’re fixing here.

Revit_glTF_Exporter_2021/Revit_glTF_Exporter_2021.csproj (1)

93-101: Verify Revit-add-in discovery when switching from ALLUSERSPROFILE to APPDATA.

Revit’s documented lookup paths for ApplicationPlugins default to %ProgramData% (≙ ALLUSERSPROFILE) rather than %AppData%.
Moving the bundle to a per-user roaming folder may prevent Revit from loading the add-in unless a custom search path is configured.

Request a quick smoke-test on a clean machine (no prior installer) to confirm that the .bundle dropped under:

%AppData%\Autodesk\ApplicationPlugins\

is still discovered by Revit 2021.
If that is not the case, consider copying to both locations or falling back to the original path in Release builds.

Revit_glTF_Exporter_2019/Revit_glTF_Exporter_2019.csproj (1)

98-108: Verify per-user install location is acceptable for all deployment scenarios

Changing from $(ALLUSERSPROFILE) (%ProgramData%) to $(APPDATA) switches the bundle from a machine-wide to a per-user install.

Revit does support %AppData%\Autodesk\ApplicationPlugins, but this breaks:

• company-wide deployments via MSI/GPO
• multiple-user machines (each user will compile/copy separately)

Please confirm this is intentional for 2019 exporter; otherwise consider making the target configurable (e.g. an MSBuild property) or keep both locations.

Revit_glTF_Exporter_2020/Revit_glTF_Exporter_2020.csproj (1)

142-148: Good move to user-scope deployment, but double-check non-Debug builds.

The post-build script only runs when $(ConfigurationName) == Debug. Release and custom Revit-specific configurations now deploy to the old All Users location (or nowhere).
Confirm this is intentional; if not, replicate the updated paths (or refactor into a shared target) for parity across build types.

Common_glTF_Exporter/Core/GLTFMaterial.cs (1)

36-37: LGTM! Clean property addition.

The new TintColour property follows the established pattern with the [JsonIgnore] attribute and matches the type convention used for BaseColor. This integrates well with the tinting functionality introduced in the broader refactor.

Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs (1)

217-218: LGTM! Correctly integrates tint color support.

The addition of material.TintColour parameter properly integrates the new tinting functionality into the image blending pipeline. The parameter order matches the updated BitmapsUtils.BlendImageWithColor method signature.

Common_glTF_Exporter/Core/GlTFExportContext.cs (2)

301-301: Direct UV retrieval simplifies the logic.

Good simplification by directly retrieving UVs from the polymesh instead of using the removed UV calculation classes.


317-321: UV mapping logic validated – no changes required

  • No references to deprecated UV classes (e.g., VertexUvs, CylindricalUv, PlanarUv) remain.
  • In GLTFBinaryDataUtils.cs, UVs are collected and exported from geomData.Uvs only when present.
  • In glTFExportUtils.cs, UV export is gated by both baseColorTexture != null and geomData.Uvs.Count > 0, matching the new addition condition.

The updated conditional (preferences.materials == MaterialsEnum.textures && currentMaterial?.EmbeddedTexturePath != null) aligns with the existing export checks and preserves the previous UV mapping behavior.

Common_glTF_Exporter/Common_glTF_Exporter.projitems (1)

43-43: LGTM! Project file correctly reflects the refactoring.

The addition of MaterialTextures.cs aligns with the centralized texture property handling introduced in this refactor, replacing the removed UV calculation classes.

Common_glTF_Exporter/Materials/RevitMaterials.cs (1)

65-65: Excellent refactoring to centralize texture handling.

The replacement of inline texture extraction logic with MaterialTextures.SetMaterialTextures improves code organization and maintainability by centralizing texture property management.

Common_glTF_Exporter/Materials/MaterialTextures.cs (2)

77-78: LGTM: Texture scaling logic is mathematically correct.

The inverse scaling calculation 1f / scaleX and 1f / scaleY correctly converts from material space to UV space coordinates.


70-81: Resolve Texture Index Placeholder Usage

The index = -1 acts as a sentinel indicating “unassigned” for baseColorTexture. In GLTFBinaryDataUtils.cs, the exporter checks for index == -1 and then embeds the texture and updates baseColorTexture.index with the actual texture index. No change is needed here.

Common_glTF_Exporter/Materials/BitmapsUtils.cs (5)

39-41: LGTM: Improved early exit logic with tint color consideration.

The early exit optimization correctly checks for both flat color blending and tint color to avoid unnecessary processing when no color modifications are needed.


44-55: LGTM: Proper handling of flat color blending parameters.

The logic correctly handles the case where flat color blending is disabled by setting appropriate blend factors and converting flat colors to linear space only when needed.


57-64: LGTM: Correct tint color initialization and conversion.

The tint factors are properly initialized to neutral values (1.0) and converted to linear space only when a tint color is provided. This ensures multiplicative tinting works correctly.


85-97: LGTM: Mathematically correct color blending and tinting implementation.

The pixel processing correctly:

  1. Converts sRGB to linear color space
  2. Applies flat color blending using fade factors
  3. Applies multiplicative tinting
  4. Converts back to sRGB for output

The order of operations is correct for realistic color blending.


125-137: LGTM: Standard sRGB/linear color space conversion functions.

The SrgbToLinear and LinearToSrgb functions implement the standard sRGB specification correctly, matching the implementation in MaterialProperties.cs.

Common_glTF_Exporter/Materials/AssetProperties.cs (6)

11-17: LGTM: Improved type safety with strongly-typed constants.

Replacing hardcoded strings with strongly-typed constants from the Autodesk.Revit.DB.Visual namespace improves maintainability and reduces the risk of typos.


40-40: LGTM: Consistent use of strongly-typed constants.

Updated to use UnifiedBitmap.UnifiedbitmapBitmap constant instead of hardcoded string, improving type safety.


66-66: LGTM: Consistent constant usage for diffuse color property.

Updated to use Generic.GenericDiffuse constant, maintaining consistency with the DIFFUSE_NAMES array.


82-83: LGTM: Consistent constant usage for texture rotation.

Updated to use UnifiedBitmap.TextureWAngle constant for better type safety.


113-139: LGTM: Well-implemented tint color extraction with proper validation.

The GetTint method correctly:

  1. Checks if tinting is enabled via the toggle property
  2. Extracts RGBA values from the tint color property
  3. Converts from normalized doubles to byte values
  4. Returns null when tinting is disabled

The logic handles edge cases appropriately.


141-151: LGTM: Simple and correct fade value extraction.

The GetFade method properly extracts the fade value from the asset property and provides a sensible default value of 1.0 when the property is not found.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
Common_glTF_Exporter/Materials/MaterialTextures.cs (1)

50-74: Consider setting baseColorFactor to incorporate BaseColor values.

The method sets various texture properties including BaseColor (line 60), but doesn't set the baseColorFactor on the PBR material. Based on the past review comment and the pattern in MaterialProperties.cs, you might want to consider setting the baseColorFactor here to incorporate the actual BaseColor values rather than relying on the hardcoded white values set elsewhere.

However, since this is now handled by the separate SetMaterialColour method in MaterialProperties.cs, this concern may be addressed through that integration point.

🧹 Nitpick comments (1)
Common_glTF_Exporter/Materials/MaterialTextures.cs (1)

1-15: Remove unused imports to improve code clarity.

Several imports appear to be unused and should be removed:

  • System.IO.Ports (line 10)
  • System.Windows.Controls (line 11)
  • System.Windows.Media.Media3D (line 12)
-using System.IO.Ports;
-using System.Windows.Controls;
-using System.Windows.Media.Media3D;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54b6910 and e8aa349.

📒 Files selected for processing (11)
  • Common_glTF_Exporter/Core/GlTFExportContext.cs (3 hunks)
  • Common_glTF_Exporter/Materials/BitmapsUtils.cs (1 hunks)
  • Common_glTF_Exporter/Materials/MaterialProperties.cs (1 hunks)
  • Common_glTF_Exporter/Materials/MaterialTextures.cs (1 hunks)
  • Common_glTF_Exporter/Materials/RevitMaterials.cs (2 hunks)
  • Revit_glTF_Exporter_2019/Revit_glTF_Exporter_2019.csproj (1 hunks)
  • Revit_glTF_Exporter_2020/Revit_glTF_Exporter_2020.csproj (1 hunks)
  • Revit_glTF_Exporter_2021/Revit_glTF_Exporter_2021.csproj (1 hunks)
  • Revit_glTF_Exporter_2022/Revit_glTF_Exporter_2022.csproj (1 hunks)
  • Revit_glTF_Exporter_2023/Revit_glTF_Exporter_2023.csproj (1 hunks)
  • Revit_glTF_Exporter_2024/Revit_glTF_Exporter_2024.csproj (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • Revit_glTF_Exporter_2024/Revit_glTF_Exporter_2024.csproj
  • Revit_glTF_Exporter_2019/Revit_glTF_Exporter_2019.csproj
  • Common_glTF_Exporter/Core/GlTFExportContext.cs
  • Revit_glTF_Exporter_2021/Revit_glTF_Exporter_2021.csproj
  • Revit_glTF_Exporter_2023/Revit_glTF_Exporter_2023.csproj
  • Common_glTF_Exporter/Materials/BitmapsUtils.cs
  • Revit_glTF_Exporter_2020/Revit_glTF_Exporter_2020.csproj
  • Revit_glTF_Exporter_2022/Revit_glTF_Exporter_2022.csproj
  • Common_glTF_Exporter/Materials/RevitMaterials.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (3)
Common_glTF_Exporter/Materials/MaterialProperties.cs (1)

22-56: LGTM - Well-structured conditional color handling.

The new SetMaterialColour method correctly implements conditional baseColorFactor setting:

  • When no embedded texture exists, it properly converts the node's sRGB color to linear space
  • When an embedded texture is present, it sets baseColorFactor to white to allow the texture to show through
  • The sRGB to linear conversion is mathematically correct for glTF compliance

This approach aligns with glTF best practices where baseColorFactor acts as a multiplier for the base color texture.

Common_glTF_Exporter/Materials/MaterialTextures.cs (2)

20-48: LGTM - Robust texture extraction with proper validation.

The SetMaterialTextures method implements good defensive programming:

  • Validates AppearanceAssetId is not invalid
  • Checks if AppearanceAssetElement exists
  • Verifies texture path exists on disk before processing
  • Properly delegates texture setup to private method

The logic flow is clear and handles edge cases appropriately.


62-73: Please confirm the intended inversion of texture scale values.

The code currently inverts the real-world scales:

  • File Common_glTF_Exporter/Materials/MaterialTextures.cs (lines 62–73)
    scale = new float[] { 1f / scaleX, 1f / scaleY },

Ensure that using 1f/scaleX and 1f/scaleY produces the correct UV scaling direction in your target runtime. If this inversion is deliberate (e.g., converting world units to UV space), no change is needed; otherwise adjust the scale factors to match your desired behavior.

@vnoves vnoves merged commit c4d346a into develop Jul 10, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jul 10, 2025
@vnoves vnoves deleted the FixMissingTextures branch July 24, 2025 14:47
This was referenced Jul 25, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 11, 2025
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