BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

More .animated functions?

2 posters

Go down

More .animated functions? Empty More .animated functions?

Post by Delsin Wed Apr 29, 2020 1:40 pm

Is it possible to have functions in .animated file that return position or rotation of any car or bogie relative to the .animated object it's in? A few devs I know are working on implementing animated bolster anchor systems on bogies, but this doesn't seem possible without functions like this.
Delsin
Delsin

Posts : 313
Join date : 2016-08-20

Back to top Go down

More .animated functions? Empty Re: More .animated functions?

Post by BPI-919 Andris Thu Aug 19, 2021 10:04 pm

Hi,

That came to mind that the .b3d files there are these commands:
- TranslateAll
- RotateAll
- ScaleAll
- ColorAll
- EmissiveColorAll
etc.

Of the above commands only the first two have a function that can be mapped at the .animated file level:
- TranslateAll -> TranslateXFunction, TranslateYFunction, TranslateZFunction
- RotateAll -> RotateXFunction, RotateYFunction, RotateZFunction

My idea would be to give other .b3d file level commands a function that can be matched at the .animated file level, similar to what was written above, so:
- ScaleAll -> ScaleXFunction, ScaleYFunction, ScaleZFunction
- ColorAll -> ColorRFunction / ColorRedFunction, ColorGFunction / ColorGreenFunction, ColorBFunction / ColorBlueFunction
- EmissiveColorAll -> EmissiveColorRFunction / EmissiveColorRedFunction, EmissiveColorGFunction / EmissiveColorGreenFunction, EmissiveColorBFunction / EmissiveColorBlueFunction

Personally, I would welcome these innovations to avoid duplication of file content, because if other .b3d files cannot be referenced in .b3d files, hopefully there is another way to avoid this problem, such as introducing new .animated file features.

Suppose we have two .b3d files that differ only in that at one end there is a command like this: "RotateAll 0, 1, 0, 180".
Both .b3d files are linked to one .animated file, so:
"
[Object]
States = something_1.b3d

[Object]
States = something_2.b3d
"

Instead, we could solve it by having only the file something_1.b3d, and we would duplicate it two times, after reversing the duplication:
"
[Object]
States = something_1.b3d

[Object]
States = something_1.b3d
RotateYFunction = 3.1416
"

This is also okay, but for example for the EmissiveColorAll command, I can't solve this with the current methods like this:
"
[Object]
States = something_1.b3d

[Object]
States = something_1.b3d
EmissiveColorRFunction = 255
EmissiveColorGFunction = 255
EmissiveColorBFunction = 255
"
Unfortunately, here you need two identical .b3d files with an "EmissiveColorAll 255, 255, 255" command at the second end.

If this feature extension were feasible, there would be no need to worry about file duplications.
In case of duplication, it is necessary to modify in both files, if we modify or specify something, or we also reserve unnecessary storage space.

Chris, please, can you make this happen?

Thanks,
Andrew
BPI-919 Andris
BPI-919 Andris

Posts : 6
Join date : 2020-09-01
Age : 25

https://bpi-919.github.io/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum