Skip to content

feat(tagger): honor explicit ComponentTags label over content path - #11

Open
youtalk wants to merge 2 commits into
ue58-devfrom
fix/tagger-componenttags-label
Open

feat(tagger): honor explicit ComponentTags label over content path#11
youtalk wants to merge 2 commits into
ue58-devfrom
fix/tagger-componenttags-label

Conversation

@youtalk

@youtalk youtalk commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Description

ATagger::TagActor derives each primitive's semantic CityObjectLabel from its mesh asset's content-path folder name (GetLabelByPath). Imported maps whose assets live outside the recognized label folders — e.g. AWSIM or other third-party content — are therefore tagged None and render black in the semantic_segmentation camera, with no way to correct them short of relocating the assets.

This change lets an explicit ComponentTags[0] take precedence: when present and it resolves through GetLabelByFolderName to a non-None label, it is used instead of the path-derived label. A map author can then tag imported meshes per component (in the editor or via Python) without moving assets. Behaviour is unchanged when no ComponentTags are set. Applied to both the static- and skeletal-mesh branches.

Base branch: ue58-dev (retargeted from ue5-dev). The two substantive commits were rebased onto origin/ue58-dev; the branch's old fork-CI commit was dropped because ue58-dev already carries its UE 5.8 equivalent. ue58-dev's Tagger.cpp is unchanged from ue5-dev in this area — it still writes ComponentTags and reads them back in GetTagOfTaggedComponent, but never honours an editor-set tag as an override — so the fix applies as-is.

Where has this been tested?

  • Platform(s): Linux (Ubuntu), CARLA UE5 fork build
  • Python version(s): 3.12
  • Unreal Engine version(s): originally UE 5.5.4; the rebase onto ue58-dev was compile-checked against UE 5.8

Behavioural verification (on 5.5.4, before the rebase): on the Nishi-Shinjuku AWSIM map, setting ComponentTags on the imported meshes and rebuilding produces a correct CityScapes-palette segmentation (road / building / vegetation / sky / traffic-light / pole) where the semantic_segmentation camera was previously all black.

UE 5.8 verification (after the rebase): Tagger.cpp compiles clean against 5.8 in the adaptive non-unity working set. The surrounding carla-unreal-editor target does not currently link on this branch, but it fails identically with and without this patch — 16 pre-existing errors in Sky.h, CarlaStatics.cpp, CarlaActor.cpp, CarlaGameModeBase.cpp and OpenDriveGenerator.cpp (missing includes that only resolve inside unity blobs, plus -Werror unreachable-code diagnostics). Those are unrelated to this change and are not addressed here.

Possible Drawbacks

The first ComponentTags entry becomes significant for taggable actors. An actor that already used ComponentTags[0] for an unrelated string matching a CARLA label folder name (e.g. "Road", "Building") would be relabelled; in practice CARLA does not set ComponentTags on taggable meshes, and any non-matching tag is ignored (falls back to the existing path-based behaviour).

ATagger::TagActor derives each primitive's semantic CityObjectLabel from
its mesh asset's content-path folder name (GetLabelByPath). Imported maps
whose assets live outside the recognized label folders -- e.g. AWSIM or
other third-party content -- are therefore tagged None and render black
in the semantic_segmentation camera, with no way to correct them short of
relocating the assets.

Let an explicit ComponentTags[0] take precedence: when present and it
resolves through GetLabelByFolderName to a non-None label, use it instead
of the path-derived label. This lets a map author tag imported meshes per
component (in the editor or via Python) without moving assets. Behaviour
is unchanged when no ComponentTags are set. Applied to both the static-
and skeletal-mesh branches.

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
@youtalk
youtalk force-pushed the fix/tagger-componenttags-label branch from 5a3073a to cec1c5d Compare September 5, 2026 04:12
@youtalk
youtalk changed the base branch from ue5-dev to ue58-dev September 5, 2026 04:12
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