Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
316 stars 56 forks source link

[Feature Request] - Display 'model' for entities that take key/value 'model' and 'model2'. #140

Open stoofphen opened 1 year ago

stoofphen commented 1 year ago

Hi there. I think that given the variety of entities that take the key/value of 'model', aside from the misc_model entity, this would be useful to display the model for other entities (such as misc_model_static, misc_modelbreakable). Some func entities also use 'model2' key, such as func_door, func_breakable et cetera that integrates a model as part of the entity's origin (and takes the key 'modelAngles' for the angles of the model).

Garux commented 1 year ago

Any point entity may be defined as miscmodel https://github.com/Garux/netradiant-custom/commit/f9157a6993bf9e9297b407fa265f1cfac84bbbea Miscmodel is handled in many special ways: requests model path, missing display is different, supports transform keys, supports remaps. Moving all this to regular point entity is not best idea. Model2 would be nice to display, but challenging. Idk how often this is used practically, most of time i'd expect baked model, as format requirements are way less strict.

Garux commented 1 year ago

Hm, correct model2 display is the problem, as origin is calculated during build from origin brush.

stoofphen commented 1 year ago

I would agree that model2 may not be as useful given the baking of models, i.e. targeting a miscmodel to these func entities (as I am often doing).

While most misc_* entities display models, the misc_model_breakable, misc_model_static and misc_model_ghoul do not display them.

Garux commented 1 year ago

Yes, you need to define them as of miscmodel type in .ent, @MoritzJT has halfway ported .defs doing this. I inspected all existing ent defs, and misc_model_ prefix is only a thing in raven entities, so technically i can harcode this prefix to be handled as miscmodel sign. But there are two problems: do all of these support model altering? it's better to have default model, while raven .defs have quite freestyle formatting In general .ent is better way for this, allow per entity class miscmodel property and default model value.

MoritzJT commented 1 year ago

How about enhancing the misc_model targetting to bake .bsp model to bmodel for movers - and instead have it support an extra spawnflag or sth to then on compile time move the modelstring from that misc_model to the model2 key? That way the mapper gets a preview too...

Then again - in JKA we have model2angles and model2scale for specific mover entities limited to specific gametypes - it would require taking that into consideration as well.

Garux commented 1 year ago

Some compromise solution, still no correct position preview.

MoritzJT commented 1 year ago

Could use model origin as origin for brushgroup then... Inheriting angles to model2angles and modelscale to model2scale (modelscale_vec is not supported on model2 for all I know) instead of using origin brush. So either use model2 key without preview and origin brush or use miscmodel targeted with special key to func to be used as origin and to copy model2 stuff from.