User Tag List

Results 1 to 18 of 18

Thread: Vertex Animation Script for Blender 3D Users

  1. #1
    2

    Vertex Animation Script for Blender 3D Users

    If you've been waiting for a Blender version of the Vertex Animation max script you've come to the right place! I've recently been working on one, and have a pretty solid version. As of now the script only has the timeline animation functionality, but I plan to remedy that soon. I'm new to scripting so I'm sure it's not very pythonic or elegant, but it works. In fact this is my first attempt at creating anything remotely complex. I'm assuming anyone coming here knows how to install or use scripts in Blender. If you have any questions feedback please feel free to leave it here or PM me. I plan on trying for a full suite of tools like something similar to Pivot Painter and maybe even the older Morph Target script. I'm open for suggestions as well. But to get right to it I'll be posting the GitHub repo below and quick tutorial.

    https://github.com/JoshuaRBogart/unreal_tools?files=1

    The new panel is located in the object mode tool shelf.

    Name:  script_tut.png
Views: 847
Size:  104.5 KB

    Make sure your timeline settings are correct and the objects you want are selected. Don't work about selecting anything other than meshes the script will ignore any object without mesh data.

    After pressing the button (the operator can also be executed with the space bar and searching for "process animated meshes") the script will create a single mesh called "Export_Mesh" from all meshes combined with correct transforms from frame one.

    The script also creates two textures new textures one "morphs" and "normals". They can be found in the UV/Image editor. You'll need to save "morphs" as an OpenEXR with RGBA and 16 bit depth in other words check Float(Half) next to color depth.

    Name:  script_tut_01.png
Views: 635
Size:  13.2 KB

    To save "normals" is even simpler. You'll need to save it as a BMP or bitmap with RGB checked.

    Name:  script_tut_02.png
Views: 626
Size:  6.1 KB

    Now all you need to do is export "Export_Mesh." I'm assuming you already know how to export a static mesh from blender for UE4 if anyone has any questions just let me know. Just make sure you create a material slot for it.

    Time for Importing!

    Your settings for your static mesh should look like this

    Name:  script_tut_03.png
Views: 637
Size:  55.5 KB

    and this.

    Name:  script_tut_05.png
Views: 631
Size:  41.4 KB

    These are the settings for the morph EXR

    Name:  script_tut_06.png
Views: 629
Size:  41.8 KB

    and these are for the BMP.

    Name:  script_tut_04.png
Views: 622
Size:  47.0 KB

    I was going to explain the whole material setup, but I'll just link to the original tutorial for the max script. It explains the process far better than I have the time to atm. Just go here and follow the material setup portion.

    https://docs.unrealengine.com/latest/INT/Engine/Animation/Tools/VertexAnimationTool/VAT_TL_Meshes/index.html

    Name:  Jiffy.gif
Views: 615
Size:  624.7 KB
    Last edited by Josh Bogart; 06-05-2017 at 05:59 AM.

  2. #2
    0
    You have no idea how happy I am to see that someone's made this, especially since you plan on working on even more. It's always nice to see Blender get support from people. Keep up the amazing work!

    All that being said, it seems I don't actually know how to do the animation part in order to actually use this. Namely because I've only ever done skeletal animation. So if anyone happens to have any resources I could look at, that'd be great. The GIF you have at the end there looks really good.

    Edit: I realized I was just being dumb, I was able to get an animation that was made with a skeleton in there. After running into a couple issues (on my end). It seems to be working as expected, which is great.

    Thanks for making this!
    Last edited by Inferno630; 02-18-2017 at 06:20 AM.

  3. #3
    0
    It's good to hear it's already being put to use! I should have checked using skeletal animation to begin with. I'm glad it works. I had just assumed because it worked with shape keys (Blender's morph targets). That's how I went about the animation in the gif. They're just being scaled up on a curve using a curve modifier. They also have a shape key for the cap opening.
    Last edited by Josh Bogart; 02-18-2017 at 01:03 PM.

  4. #4
    0
    Hey! I hate to sound like a noob, but what is different between this and morph targets?


    Thanks!!!

  5. #5
    0
    Hey if you never ask questions you only make it harder to learn anything. Morph targets can only be used with skeletal meshes. This is all driven in a material using world position offset on a static mesh. This is useful because it can be used as mesh data in a particle system. Whereas skeletal meshes can't. Morph targets are also only like snap shots or just key frames out of an animation that you linearly interpolate through. This is a fully animated mesh. Whereas normally this could only be accomplished with bones. Hope that helps some!
    Last edited by Josh Bogart; 02-22-2017 at 12:25 AM.

  6. #6
    0
    A couple more questions:

    1. The information baked on UV channel 2 is based entirely off how many vertices there are, correct? (basically, it's the thing that lets each track control a vertex) I'm only checking because I was planning on using it for multiple animations on the same mesh, but had forgotten about that aspect; looking at it (and to a degree the code) seems to imply that that's what it does, but I'm not absolutely certain, so confirmation would be great.

    2. Would it be possible to modify the script to keep the UV channel 1 data from the original mesh? Because as far as I can tell, it doesn't keep that information.

  7. #7
    0
    Inferno630 to your your first question. Yes, the script takes every vertex loop and spreads them out evenly across the V or Y axis from right to left, for whatever reason they had to go from right to left. This is why the image width is also equal to the number of vertices. So each vertex is sampling a pixel that's giving it X,Y, and Z offsets through R,G, and B. You should be able to use multiple animations. You could probably use the same image just turn multiple animations into one big one. Then do something with material instance parameters to pick where at in the animation you want to play, or in this case the list of animations. Or you could just use the script multiple times to produce several images and just use parameters to switch between different texture objects.

    To your second question. The UVs in channel one should be saved even if you've combined several meshes they should have just been combined as well. So that if you had copies of the same mesh, like I did in my example, if you went to the UV editor all the island copies would be there stacked on top of one another. It's one of those things I'd looked into adding as a feature but just worked as a result of the way I'm coping mesh data.
    Last edited by Josh Bogart; 02-23-2017 at 05:04 PM.

  8. #8
    0
    Alright, good to know. That's what I was thinking, but it's still good to get verification.

    Huh, I guess the UV information is kept. I must have done something wrong with my initial testing of it.

    Thanks for the quick response.

  9. #9
    0
    Yeah, no problem. I need to comment the script out a bit better. Well a lot better to honest lol. Maybe add a little more to the ReadMe. If you have any more questions or suggestions for documentation let me know. I'm thinking of just making a little video tutorial. Maybe a quick animation tutorial appended at the end to get the same results. It's definitely a relief to hear you're getting UVs in channel one. I thought I had a big bug on my hands. Though I was trying to get a replication and found that if one mesh has UVs on channel 1 and others don't Blender will crash. So there's that... It's an all or nothing kind of thing.

  10. #10
    0
    OOHHH MYYY GOOOOO-O-O-O-O-oOOOoooOooOOOOOOOOOOOOOoooOOODDDD!!!!!

  11. #11
    0
    Quote Originally Posted by StevenWaltherMedia View Post
    OOHHH MYYY GOOOOO-O-O-O-O-oOOOoooOooOOOOOOOOOOOOOoooOOODDDD!!!!!
    Good things bad things?

  12. #12
    0
    shared on my youtube page, and on one of the biggest vfx forums.
    Keep up the good work, and hopefully you find time to add more functionality

  13. #13
    0
    Cool stuff, but why can't you simply use Alembic for this ?

  14. #14
    0
    Thanks Luos, I hope I find the time as well.

  15. #15
    0
    I'm not sure about performance trade offs or anything. The point of this tool is for using the static mesh in a particle system. If you're importing the Alembic file as a static mesh (not as skeletal or a geo cache) I'm assuming it would be similar. This is all driven by textures in the meshes material though which could have parameters exposed in cascade and or blueprint. I'm not very familiar with using the alembic format though so I don't know if you could achieve similar results.
    Last edited by Josh Bogart; 03-29-2017 at 12:58 PM.

  16. #16
    0
    Unreal Engine Developer
    Join Date
    Apr 2014
    Posts
    11
    Very cool!

  17. #17
    0
    Quote Originally Posted by Josh Bogart View Post
    I'm not sure about performance trade offs or anything. The point of this tool is for using the static mesh in a particle system. If you're importing the Alembic file as a static mesh (not as skeletal or a geo cache) I'm assuming it would be similar. This is all driven by textures in the meshes material though which could have parameters exposed in cascade and or blueprint. I'm not very familiar with using the alembic format though so I don't know if you could achieve similar results.
    So, how do you animate those shrooms in Blender? BlendShapes or some fancy material driven deformations ?

  18. #18
    0
    I just scaled it along a bezier curve with a curve modifier. I used a blendshape for the cap though yes.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •