Jump to content

Search the Community

Showing results for tags 'Shape Keys'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 4 results

  1. I don't think Babylon.js supports alembic files. If not I'm thinking of parsing it and processing the vertex transformations myself. I know you can change vertex positions and normals easily in Babylon.js using mesh.updateVerticesData(BABYLON.VertexBuffer.PositionKind, newPositions); mesh.updateVerticesData(BABYLON.VertexBuffer.NormalKind, newNormals); but I think this is all done on the CPU. Is there a way to get these updates per frame to happen on the GPU?
  2. Hello, I'm posting this partly to help anyone else who has struggled with this, but also to ask if I am doing something wrong / if this is a bug in the exporter. When I export a mesh from Blender with 'Shape Keys', I have to create two Keys in addition to the Basis for it to work in Babylon. One Key + basis: https://www.babylonjs-playground.com/#0XATER#1 Two keys + basis: https://www.babylonjs-playground.com/#0XATER
  3. Whoa! Okay, there are two parts to this. Case/Issue 1: Scene picking info for animated rigs only obtains picking information from the first frame of the rig animation. I've setup a test case, http://jsfiddle.net/7x0nkh0g/3/ , where there's this cube that is being animated and moved by this bone. You can click on the cube to change it's colour between green and red. Clicking only works if you click on the mesh where it was at the first frame of animation. Doesn't canvas picking info casts a ray into the scene and looks for active faces everytime? It appears that it's using the first frame of the rig as if it was not being animated at all. This issue occurs from files exported from both Babylon and Tower Of Babel exporter from blender. Case/Issue 2: Using the Morph Extension (ver 1.1) and Tower Of Babel to import and animate shape keys created in Blender, on a mesh that also has skeletal rig and animation, morph shape offsets are relative towards the Rest Position (edit mesh position in Blender before the mesh has been set to a pose by a rig). Using the previous jsFiddle example: http://jsfiddle.net/7x0nkh0g/3/, clicking on the blue circle morph's the cube's shape into a pyramid. Only the top four keys are morphed. Notice how the top four keys try to move towards the rest position of the original mesh instead of following the translated skeletal rig's first frame. After discovering this, I created another animation rig but this time, I set the first frame of the rig to match the original rest position of the mesh and then have my usual looping animation after that. In Babylon, I then set the rig animation to skip over that first frame. This is sort of a work-around but it actually works! See: http://jsfiddle.net/7x0nkh0g/4/ The cube is being morphed to a pyramid correctly now, while still being animated by a skeletal rig. I've only tried this trick out on the test case. Can't wait to try it out on my facial shapes on top of a skeletal animation. I read in some old threads that JCPalmer might have a working copy of the Morph Extension version 1.2 hasn't been released? I'm getting depreciation messages from BJS using this old Morph Extension: "BJS - [22:36:45]: Mesh.updateVerticesDataDirectly deprecated since 2.3." On a sidenote for those test cases I've created, if you click on the blue circle to morph the shape of the cube first, then you can't click on it to change it's colour later. JS gives an error "Uncaught TypeError: Cannot read property 'subtractToRef' of undefined". Click on the cube to change its colour first and then clicking the morph next works fine however. If you need the blender file, I've attached it. cubearmatureplusdeform.zip
  4. Hello, decided that something talked about at the end of another thread was best addressed in its own thread. As intro (gryff correct as needed) Blender allows for meshes to deformed without the use of bones. This could used for animation. Not having a skeleton seems easier to do than bones in Blender to me, and the results can be way beyond them as well. Copied link from prior thread: . Question is: Is there even any hope that this could be exportable from Blender to BabylonJS? Gryff also provided a .blend, copied link Cloth Animation2 .Load it up in blender, and hit the play button, '>', in the bottom middle of the window. What I have done is run this blend through a Babylon export script with extra stuff added to find & for now write extra lines into the log file which describes the data for shape keys. FYI, the Blender doc I got my info from is at http://www.blender.org/documentation/blender_python_api_2_70_release/bpy.types.Key.html#bpy.types.Key It seems that shape keys can be shared across meshes, so I added this code to reference them this way in the main loop & a ShapeKey class because it seems the data structure is recursive: # Shape Keys from the main loopfor key in bpy.data.shape_keys: ShapeKey(key, 1)) ...class ShapeKey: def __init__(self, key, level): TowerOfBabel.log('processing begun of shape : ' + key.name, level) if hasattr(key, 'eval_time' ): TowerOfBabel.log('eval time: ' + str(key.eval_time), level + 1) if hasattr(key, 'slurph' ): TowerOfBabel.log('slurph: ' + str(key.slurph ), level + 1) if hasattr(key, 'use_relative'): TowerOfBabel.log('use relative: ' + format_bool(key.use_relative), level + 1) if hasattr(key, 'animation_data'): TowerOfBabel.log('animation_data:', level + 1) for fcurve in key.animation_data.action.fcurves: TowerOfBabel.log('fcurve.data_path:' + fcurve.data_path, level + 2) # recursion, oh crap if hasattr(key, 'key_blocks'): for block in key.key_blocks: ShapeKey(block, level + 1)This produced this output (probably a dead end from this angle): processing begun of shape : Key eval time: 0.0 slurph: 0 use relative: true animation_data: fcurve.data_path:key_blocks["Draped"].value processing begun of shape : Basis processing begun of shape : DrapedIn the processing of a mesh I added the following code if shape keys were associated: # shape keys for mesh if object.data.shape_keys: TowerOfBabel.log('Shape Key found in mesh: ' + object.data.shape_keys.name, 2) keyBlocks = object.data.shape_keys.key_blocks for block in keyBlocks: TowerOfBabel.log('Block Name: ' + block.name + ', num vertices:' + str(len(block.data)), 3) for data in block.data: vertex = data.co TowerOfBabel.log('x: ' + str(vertex.x) + ', y: '+ str(vertex.y) + ', z: ' + str(vertex.z), 4)This produced a lot of output, here is a shortened version of the log for the mesh with the shape key: processing begun of mesh: Cloth, using base class: BABYLON.Mesh WARNING: No materials have been assigned: num positions : 1156 num normals : 1156 num uvs : 0 num uvs2 : 0 num colors : 0 num indices : 6534 Shape Key found in mesh: Key Block Name: Basis, num vertices:1156 x: 1.0, y: -1.0, z: 0.0 x: -1.0, y: -1.0, z: 0.0 x: 1.0, y: 1.0, z: 0.0 x: -1.0, y: 1.0, z: 0.0 x: 0.8181818127632141, y: -1.0, z: 0.0 x: 0.6363636255264282, y: -1.0, z: 0.0 x: 0.45454543828964233, y: -1.0, z: 0.0 x: 0.27272725105285645, y: -1.0, z: 0.0 x: 0.09090906381607056, y: -1.0, z: 0.0 x: -0.09090910851955414, y: -1.0, z: 0.0 x: -0.27272728085517883, y: -1.0, z: 0.0 x: -0.4545454680919647, y: -1.0, z: 0.0 x: -0.6363636255264282, y: -1.0, z: 0.0 x: -0.8181818127632141, y: -1.0, z: 0.0 x: 0.8181818127632141, y: 1.0, z: 0.0 x: 0.6363636255264282, y: 1.0, z: 0.0 x: 0.45454543828964233, y: 1.0, z: 0.0 x: 0.27272725105285645, y: 1.0, z: 0.0 x: 0.09090906381607056, y: 1.0, z: 0.0 x: -0.09090910851955414, y: 1.0, z: 0.0 x: -0.27272728085517883, y: 1.0, z: 0.0 x: -0.4545454680919647, y: 1.0, z: 0.0 x: -0.6363636255264282, y: 1.0, z: 0.0 x: -0.8181818127632141, y: 1.0, z: 0.0 x: -1.0, y: 0.8181818127632141, z: 0.0 . . . x: 0.8787878751754761, y: 0.7575757503509521, z: 0.0 x: 0.939393937587738, y: 0.6969696879386902, z: 0.0 x: 0.939393937587738, y: 0.7575757503509521, z: 0.0 Block Name: Draped, num vertices:1156 x: 0.42931264638900757, y: -0.532781720161438, z: -0.8952973484992981 x: -0.4533596634864807, y: -0.5035873055458069, z: -0.9059669375419617 x: 0.5022068023681641, y: 0.5161137580871582, z: -0.9113012552261353 x: -0.5195051431655884, y: 0.592650294303894, z: -0.846235990524292 x: 0.315280556678772, y: -0.4323137700557709, z: -0.8073179721832275 x: 0.23072978854179382, y: -0.5339680314064026, z: -0.7025083899497986 x: 0.12728682160377502, y: -0.45900893211364746, z: -0.6225178241729736 x: 0.2509845793247223, y: -0.36435461044311523, z: -0.6379876732826233 x: 0.09559790790081024, y: -0.3883511424064636, z: -0.6364848017692566 x: -0.08387131989002228, y: -0.38822996616363525, z: -0.6374479532241821 x: -0.24025821685791016, y: -0.39399784803390503, z: -0.637752115726471 x: -0.25066906213760376, y: -0.34393423795700073, z: -0.22135230898857117 x: -0.2696780264377594, y: -0.3371814489364624, z: 0.011421998962759972 x: 0.43590784072875977, y: 0.1628814935684204, z: -0.566344141960144 x: 0.45525118708610535, y: 0.22023046016693115, z: -0.5630139708518982 x: 0.3902812600135803, y: 0.21390795707702637, z: -0.5098786950111389 x: 0.4428275227546692, y: 0.1841123402118683, z: -0.5045356154441833 x: 0.3944912552833557, y: 0.2104395627975464, z: -0.5703118443489075 x: 0.4410724639892578, y: 0.17216885089874268, z: -0.5640472173690796 x: 0.5403734445571899, y: 0.24221545457839966, z: -0.5275962352752686 x: 0.5631066560745239, y: 0.2916404604911804, z: -0.5530022382736206 x: 0.548436164855957, y: 0.2113366574048996, z: -0.5791581273078918 . . . x: 0.5152558088302612, y: 0.40521472692489624, z: -0.6688541769981384 x: 0.5745273232460022, y: 0.3480875492095947, z: -0.6703621745109558 x: 0.5555965900421143, y: 0.3864023685455322, z: -0.7100901007652283Now I recognize some of this code, but I do not know what is going on yet. If someone can enlighten me on what I might try next, I would be grateful. Jeff
×
×
  • Create New...