Skip to content

Add configurable texture output folder for appearance export#80

Closed
yaozhihang wants to merge 1 commit into
mainfrom
feature-configure-texture-output
Closed

Add configurable texture output folder for appearance export#80
yaozhihang wants to merge 1 commit into
mainfrom
feature-configure-texture-output

Conversation

@yaozhihang

Copy link
Copy Markdown
Member

Currently, textures are always exported to the fixed default relative folder appearance. This PR adds a new textureOutputFolder option to AppearanceOptions, allowing users to customize the relative folder where exported textures are written.

@yaozhihang
yaozhihang requested a review from clausnagel June 23, 2026 07:00
@clausnagel

Copy link
Copy Markdown
Member

Hi @yaozhihang, I have a few questions:

  1. What is the rationale behind this PR? I think a stable output folder has benefits.
  2. How does this behave if the user specifies an absolute path, such as /myfolder or C:\myfolder?
  3. How does it handle paths that include subdirectories, such as my/nested/folder?
  4. Does this also work when exporting to a ZIP archive?

@yaozhihang

Copy link
Copy Markdown
Member Author

Hi @yaozhihang, I have a few questions:

  1. What is the rationale behind this PR? I think a stable output folder has benefits.
  2. How does this behave if the user specifies an absolute path, such as /myfolder or C:\myfolder?
  3. How does it handle paths that include subdirectories, such as my/nested/folder?
  4. Does this also work when exporting to a ZIP archive?
  1. The main purpose is to allow exporting data into the same output folder while keeping textures from colliding within a shared appearance subdirectory. This is needed by my vis-exporter, which will reuse the citydb-operation module. The default still use appearance, so existing behavior is unchanged.
  2. It is true that the absolute path will not work properly. How about adding the following guard code into the constructor of the TextureExporter?
        Path baseDirectory = helper.getOptions().getOutputFile().getFile().getParent();
        if (baseDirectory != null
                && !baseDirectory.resolve(outputFolder).normalize().startsWith(baseDirectory)) {
            throw new IllegalArgumentException("The texture output folder must be a relative path "
                    + "inside the export target, but was '" + outputFolder + "'.");
        }
  1. Subdirectories work without problems, and this also works when exporting to a ZIP archive.

@yaozhihang

Copy link
Copy Markdown
Member Author

@clausnagel I found another workaround to avoid touching this API. We could close this PR if you think a hard-coded output texture folder is necessary

@clausnagel

Copy link
Copy Markdown
Member

Sounds good. I'll close this for now, but feel free to reopen it if you'd like to continue the discussion.

@clausnagel clausnagel closed this Jun 24, 2026
@yaozhihang
yaozhihang deleted the feature-configure-texture-output branch July 3, 2026 07:47
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.

2 participants