How to attach an imported animated mesh to an existing vehicle programmatically

Discussion in 'Programming' started by ffzero58, Nov 30, 2018.

  1. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    28
    I am trying to figure out a way to have an animated biped (with a looping ambient animation) be "attached" to the driver's seat of a vehicle.

    Right now, there does not seem to be support in jbeam to reference a mesh with its animation. It does fine when importing it as a static mesh in the World Editor with playAmbient checked. Just no way to attach it to a vehicle.

    Any tips or tricks appreciated!
     
  2. Nadeox1

    Nadeox1
    Expand Collapse
    BeamNG.Support
    Staff Member

    Joined:
    Aug 5, 2012
    Messages:
    13,187
    Vehicles have two kind of meshes, as I wrote in the other thread.
    Flexbodies, which are deformable meshes.
    Props, which are non deformable meshes.

    The second should support this (not entirely sure, as nobody ever tried AFAIK).
    https://wiki.beamng.com/Props

    Objects with animations usually auto-play as soon you add them (like for normal static). If it does not play on the vehicle, as a prop, then it means it's not supported.
     
  3. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    28
    I will give this a try. It is interesting that this has not been tried before given the age of this game/sim...
     
  4. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,779
    Only most brightest and creative persons walk these paths where mere mortals never visit :)
     
    • Like Like x 3
    • Agree Agree x 1
  5. tdev

    tdev
    Expand Collapse
    Developer
    Staff Member

    Joined:
    Aug 3, 2012
    Messages:
    2,847
    Sorry, but the vehicles don't support animated meshes, as it is very custom code and it'll not work most likely ^^
     
    • Informative Informative x 1
  6. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    28
    Yes, thank you for the feedback. I am just a mere mortal etching out a meager existence.

    I did test this before I saw your reply, tdev... you are indeed right :(

    On that note, will there be future development to have an imported DAE (with animation) be able to follow the vehicle? Maybe FBX import so that it can import morphs?

    The dream would be:
    - Import DAE
    - Lock DAE to vehicle with looping animation

    I imagine this would be a huge boon to BeamNG modding and increasing value to the product with (I feel) very minimal effort - unless there are technical limitations? The World Editor is amazing and I feel that parenting the imported DAE to the player (vehicle) would just make this game so alive.
     
  7. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    28
    I am grasping at straws here... perhaps in LUA after every tic (i.e. the vehicle changes position/orientation), then the imported mesh would also update its world coordinates and orientation to match? If possible, how would that look?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice