Skip to content

Conversation

@sevendev
Copy link
Contributor

@sevendev sevendev commented May 13, 2025

関連リンク

(Synesthesias/PLATEAU-SDK-for-Unity#481)

実装内容

FBX Exportの座標変換が2重変換になっているため変換処理削除。

レビュー前確認項目

FBX Export時の軸変換がENU/WUNで正常に行われる。
SDK v2.3.2での Export結果と同様になる。

マージ前確認項目

  • 自動ビルド・テストが通っていること
  • Squash and Mergeが選択されていること
  • (libcitygmlの変更がある場合)libcitygmlがmasterの最新版になっていること

動作確認

Unity/Unrealで、FBX Export時の軸変換がENU/WUNで正常に行われる。
Unity SDK v2.3.2での Export結果と同様になる。

その他

Summary by CodeRabbit

  • リファクタ
    • FBXシーンの座標系設定に関する処理を削除しました。

@coderabbitai
Copy link

coderabbitai bot commented May 13, 2025

Walkthrough

FBXシーンの座標系(軸システム)を設定・変換するコードが完全に削除されました。これには、座標系オプションごとに異なる軸構成を指定し、FBXシーンに適用する処理が含まれていました。代替の座標系処理は追加されていません。

Changes

ファイル/パス 変更内容の概要
src/mesh_writer/fbx_writer.cpp FBXシーンの座標系をオプションに基づいて設定・変換するコード(switch文、FbxAxisSystemの利用、ConvertSceneの呼び出し)を削除

Poem

うさぎが跳ねてコードを覗く、
軸の変換、今はなく、
シーンは素直にそのままで、
東も西も気にせずに、
軽やかに進むFBX、
コードの森に春が来た。
🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5e5641f and b7b9f16.

📒 Files selected for processing (1)
  • src/mesh_writer/fbx_writer.cpp (0 hunks)
💤 Files with no reviewable changes (1)
  • src/mesh_writer/fbx_writer.cpp
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: upload-dlls (macos-14, arm64)
  • GitHub Check: upload-dlls (windows-2022, x86_64)
  • GitHub Check: upload-dlls (ubuntu-24.04, x86_64)
  • GitHub Check: build-and-test (macos-14, arm64)
  • GitHub Check: build-and-test (windows-2022, x86_64)
  • GitHub Check: build-and-test (ubuntu-24.04, x86_64)
  • GitHub Check: upload-dlls (macos-14, x86_64)
  • GitHub Check: upload_mobile_dlls (macos-14, 33, 30.0.3, 23.1.7779620)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.

@sevendev
Copy link
Contributor Author

Walkthrough

FBXシーンの座標系(軸システム)を設定・変換するコードが完全に削除されました。これには、座標系オプションごとに異なる軸構成を指定し、FBXシーンに適用する処理が含まれていました。代替の座標系処理は追加されていません。

Changes

ファイル/パス 変更内容の概要
src/mesh_writer/fbx_writer.cpp FBXシーンの座標系をオプションに基づいて設定・変換するコード(switch文、FbxAxisSystemの利用、ConvertSceneの呼び出し)を削除

Poem

うさぎが跳ねてコードを覗く、
軸の変換、今はなく、
シーンは素直にそのままで、
東も西も気にせずに、
軽やかに進むFBX、
コードの森に春が来た。
🐇✨

Tip

⚡️ Faster reviews with caching
📜 Recent review details
Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro

📥 Commits
Reviewing files that changed from the base of the PR and between 5e5641f and b7b9f16.

📒 Files selected for processing (1)

  • src/mesh_writer/fbx_writer.cpp (0 hunks)

💤 Files with no reviewable changes (1)

  • src/mesh_writer/fbx_writer.cpp

⏰ Context from checks skipped due to timeout of 90000ms (8)
✨ Finishing Touches

  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.

@sevendev sevendev closed this May 14, 2025
@sevendev sevendev reopened this May 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 14, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the actual changes to see what coordinate system code was removed
git diff 5e5641f8cb29ec8a4d26786054ae2190067814bc b7b9f1673ac843c8b3789a947351ae18cb3d31e2 -- src/mesh_writer/fbx_writer.cpp

Length of output: 2017


🏁 Script executed:

#!/bin/bash
# View the entire fbx_writer.cpp file to understand the context better
cat src/mesh_writer/fbx_writer.cpp

Length of output: 12256


@sevendev FBXエクスポートの座標系バグについて、変更内容を詳しく見てみました。

この修正では、fbx_writer.cppから座標系変換に関するコードを削除しています。具体的には:

  1. 座標系オプション(ENU, ESU, WUN, EUN)に基づいてFbxAxisSystemを設定するコード
  2. axis_system.ConvertScene(fbx_scene)によるシーンへの座標系変換の適用

このバグはFBXエクスポート時に座標変換が二重に適用されていたことが原因でした。おそらく、データがFBXライターに到達する前に(おそらくモデル構築時かNode/Meshクラス内で)すでに座標変換が行われており、FBXライターが再度変換を適用していたと推測されます。

この修正により、ENU(East-North-Up)とWUN座標系間の変換が一度だけ行われるようになり、SDK v2.3.2と同じエクスポート結果が得られるようになります。座標変換の重複適用による歪みや回転の問題が解消され、正確なモデルエクスポートが可能になりました。

シンプルな修正ですが、3Dモデルの座標表現において非常に重要な問題を解決しています。

@tomoki-suzuki-syn
Copy link
Contributor

次の修正ブランチを取り込んだのち、マージをお願いします。
共通ライブラリのexp/fbx_fixブランチ
共通ライブラリのfbx出力でConvertSceneを消す代わりにSetAxisSystemに置き換えました。これによりfbxファイルに座標軸の方向が書き込まれるようになりました。これはFBXをASCIIで出力してテキストエディタで開くことで確認できます。
Unityのexp/fbx_fixブランチ
座標軸の向きを共通ライブラリに渡すように変更しました
Unrealの修正は共通ライブラリのみなので修正用ブランチはありません。共通ライブラリの置き換えをお願いします。

@sevendev sevendev merged commit 0c0ee5d into dev/v4 May 16, 2025
12 checks passed
@sevendev sevendev deleted the fix/fbx_export_axis branch May 16, 2025 00:05
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.

3 participants