Read model path from KV type `studio` when header property `studio()` is undefined or empty
SirYodaJedi opened this issue · comments
Like with sprite()
and <kvname>(sprite)
in #4442, an empty studio()
should read from KV(s) with type studio
.
Some sloppy psuedocode to explain what I mean:
if
studio()
orstudio("")
if exists KV type
studio
display all valid models listed in the entity's studio KV types (or at least the first one found)
(if a model is invalid, do whatever you usually do for invalid models)else
treat as undefined, and print error in console
else
treat as
model(foobar)
This allows the model to at least be displayed using unmodified Hammer 3.5 FGDs, without making hardcoding specific KVs to read from like Hammer and Jack do. While it wouldn't handle skins, scale, or anims, it allows FGD authors to not need to maintain two FGDs in this transitionary period in GoldSrc wherein mappers are divided between two editors that have similar yet partially incompatible game definition formats.
On a related note, Jack also adds additional skin(#)
, sequence(#)
, and body(#)
meta to pointclass, which are equivalent to TrenchBroom's model()'s "skin":#
, "frame":#
, and #4412. These could be parsed if said properties are absent elsewhere in the pointclass's definition, but that is less pressing than getting the model to actually display.
Also, TrenchBroom currently complains when an undefined studio()
is set as studio()
and not studio("")
; this would need to be fixed, as the former is standard.