Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] .x model selectable options support #1033

Open
hotdamndel opened this issue May 14, 2024 · 4 comments
Open

[Suggestion] .x model selectable options support #1033

hotdamndel opened this issue May 14, 2024 · 4 comments

Comments

@hotdamndel
Copy link

hotdamndel commented May 14, 2024

This is a feature found in .x models and used by, for example, Railsim (a Japanese railway layout simulator).
In Railsim example, this allows defining various model parts that can be enabled/disabled or swapped (for things like implementing train variety coming from small changes during production or car numbers) much more easily than conventionally via [object] and StateFunction in .animated. I assume this can be considerably less performance-costly as well.
No particular examples here, but any Railsim model with a good functionality can demonstrate that.

@leezer3
Copy link
Owner

leezer3 commented May 14, 2024

It isn't really going to be any different in terms of pure speed, that's just a function of polys + movement of any description.

X files (and for that matter most standard animation formats) use matrix keyframes (generally chained and interpolation between them.
These are somewhere on a massive list of things I've not got as far as doing, as it requires a bunch of redesign work to the internals of the animated format....

@hotdamndel
Copy link
Author

This isn't about animation, more like state changes from the option provided in the file, so no interpolation needed. And these don't really need to be animated (mostly just for Railsim model options support, .x models currently just load with all the options enabled at the same time and texture selections/shifts reverted to default with no way to change that via .animated). Railsim implementation of these features is really clever and simple, I'd like to see this work in Openbve

@leezer3
Copy link
Owner

leezer3 commented May 14, 2024

My point is that these changes are controlled by the animation keyframes.
Basically, the X options just set a set of keyframes to be shown.

In order to get that working properly, we need proper support for the full keyframe and matrix chain support.

@ginga81
Copy link
Contributor

ginga81 commented May 14, 2024

I'm sorry to go off topic, but I hope that we analyzed Railsim's GPL code and made it easier than BVEC_ATS and animated's functions to link object bones to reproduce the driving wheels of a locomotive, and to animate the rise and fall of a pantograph.

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

No branches or pull requests

3 participants