[ADDON ] UE Tools

:

Thanks for the response. I’ve been playing with it a bit, and I think it would be possible to create a rigify-type system for the Unreal rig, but it would be a fair amount of work. You’d need to start with the basic Epic rig - just the non-IK deform bones, have them change the bone size and positions in edit mode, and then generate a new armature using the bone positions.

I may try and do something like that if/when I find some free time. If I do, I’ll throw the results up here in case you want to roll them back in.

Nice, thanks! ****](https://forums.unrealengine.com/member.php?10518-) And yes I remember the first thing I thought when I read the rigify addon was , mm well yes is posible but require alot of work , so I thought well … first create the rig and then maybe I can write a script for output the data for the rigify… then I forgot rigify. Edit the Rig is not a big deal after all (I will try to show it in a video).

And well, I see you are a contributor to the engine so I will assume you are familiar with the UE4 API and c++

I have something in mind now for the addon, I have the structure and the knowledge for start doing things in python but I need some guidance / help / contribution on the UE4 side in c++.

Let me explain you:

What I want is grab all the position/rotation/scale in scene(world space), save it in a text file or CSV as a datatable (also a parameter for if the object must be an instance) and then through a plugin in UE4 make a couple buttons, one for load and another for save the data in CSV file.

The load button must load the data on the datatable exported in and find the asset in the content folder, if exist spawn the asset in the position specified in the data table. The second buton ( for save) will save the positions of the objects in the UE4 scene and update the CSV file. Also I want to put a button in for reload the CSV file.

I don’t want to do in real time , I prefer a couple buttons for save resources.

So, can you give me some guidance/help on where to look on UE4 API ?, or if the engine have a specific function for example, for search in content folder and spawn the asset…or combination of functions… stuff like that

I assume that should not be too difficult to make UE4 can read a text file with a data table and place objects in the scene according to the table. But really the only thing I have in c ++ is a plugin with a button that does nothing, well a message in log (I made the plugin just using “plugin creator wizard”) for start testing things and familiarize with c++ a little more

My intention is, when the addon and the plugin for UE4 is done (I want polish a couple things and add at least, a way for export premade physics animation as a skeletal mesh to the addon), submit to the UE4 so can be released With the engine (the addon and the plugin) Although not really know how I should do that and if will be acepted etc…;), all in good time.

Thanks again

Greetings!

:

I don’t think that should be that hard. I haven’t written an editor plugin that adds buttons to the interface, but I don’t believe the process is hard. You have to know where you want to add the buttons, though, before you can figure out how to add them because different toolbars and menus are controlled by different engine modules.

Loading in files from a text file is pretty straightfoward as well.



	FString FullPath = FPaths::GameDir() + "Content/MyDataFolder/" + MyFileName;
	FString Contents;
	FFileHelper::LoadFileToString(Contents, *FullPath);


There’s also a JSON parser built in to the engine if you’d rather use JSON than CSV. There are good Python JSON libraries, and if you decided you wanted more complex data, it would be much easier to add with JSON than CSV.

What are you looking to do with the data once it’s imported? I assume that you’d want to set bone positions in model space based on the contents of the data? I’d have to research that a little, honestly. I’ve never edited a skeletal mesh or animation through code, but I doubt it would be that hard.

Thanks for the info. I’m sure it will be useful. I will investigate the engine modules, perhaps will be more interesting placing the buttons in some other place. So far the generated plugin has put the button in the bar of the editor ( the bar for open Matinee, to build light, create a blueprint level etc …) You’re right, JSON is perhaps best option, I had no idea UE4 have a JSON parser built in to the engine, I will look at that too.

The data is to reposition objects in the scene. Something that allows me to reconstruct the scene in UE4 without having to position objects manually once imported.

something like that:

It occurred to me after seeing digital tutors have a tutorial about “Using DataTables to Create Data Driven Gameplay in Unreal Engine”, using blueprint function libraries and then I thought I could start there (adapted to my needs) and then adapt it to a plugin. I guess with this tutorial could create a blueprint, containing all objects in my scene, and reposition the objects acording the the data file ( in the case of the tutorial, CSV). But then it might be more complicated to edit the objects or to manage the scene in layers etc…

The data structure I have in mind is like that: (nothing fancy)

ObjectName,ObjectMesh,IsInstance?,LocationX,LocationY,LocationZ,RotationX,RotationY,RotationZ,ScaleX,ScaleY,ScaleZ

So basically I want to read that data, search if I have the object imported (in a content folder or subfolders as .uasset) and then place the object in the scene acording to the data.

Also the ability to modify the scene in UE4 and save/update the data file for load in .

Perhaps this is not the best way to do this, I don’t know. But to me seems not to complicated to do and maintain( I mean is not a new algorithm for GI and stuff like that form the masters) and can save lot of time

@ this Addon looks fantastic thanks for this ^^

I go to try this week the addon

Love this, keep it up! :slight_smile:

Seems like an excellent plugin! I do have an issue. No matter what, my character gets imported like this:
1b6f58ee40990d47619c8e80ff73b80ea38dc6b6.jpeg

Notice the foot is rotated, the hero is on its stomach, the animation isn’t necessarily working correctly. Any idea what would cause this?

Thanks!

It looks like you imported onto the existing UE4_Mannequin_Skeleton. Because of an issue with the exporter, you can’t do that. You have to let it create a new skeleton on import, and then use retargeting to copy the animations over to your new skeleton. shows that process in the videos.

  • I had an idea that might let you easily change proportions of the rig without having to do the whole Rigify-style script.

If you divide it out into two separate armatures - a control rig with all the IK chains and other constraints, and then a controlled rig with just the deform bones, you could then change the proportions of the deformed bones more easily and without accidentally messing up the control rig, since it’s a separate object.

Here’s a file where I’ve done this - basically just two copies of your armature, pointed the constraints from one at the other, then deleted the unneeded parts from each.

It would probably be pretty trivial to script adding the constraints, also.

Here’s a first shot at putting that idea together:

Included in that blend file is a python script with several UE4-specific tools, including one that adds copy constraints from the control rig to a controlled rig. There’s also rename buttons to let you conform the names to 's naming convention so that x-axis mirroring works in pose mode, and then others to switch back to standard UE4 names for exporting so the names match up for retargeting.

****](https://forums.unrealengine.com/member.php?10518-) I will take a look, thanks! also, i thinck I found why is not posible import animations direcly to the manequin without retargeting. I think the problem reside on the heiriachy, the chain of parents is diferent in my rig than the manequin in UE4 ( I have to check it but I’m nearly sure 100 %). When I start I was thinking only in the names of the bones , rotation and roll but after watching these videos from epic, seems the heiriachy is really important too.

https://www.com/playlist?list=PLZlv_N0_O1gbwdyIm78w42fZ1t8dDClsI

I’ll see if I can get some time to do all these things (including the video I promised on how to adapt the rig to different proportions)

Greetings!

I get an error when trying to use the plugin in a new scene, line 1873, in execute bpy.context.scene.objects.active = bpydata.objects"SK_MannequinMesh"] , KeyError: … … “SK_MannequinMesh” not found.

When I export I get from the "Error Mesh contains HeroTPP_MESH bone as root but animation doesn’t contain the root track.
Import failed. "

oh wait no, I got it and it’s working, I just got a short temper and shorter patience sometimes

seems to me that it’s not possible to “paste x flipped pose”, because the manequen is on the y-axis. Is there any possible way to mirror poses, because this makes it really hard to make walk cycles.

Ah wait I just read the above post, I look like a real dork right now.

The arms seem to work with “paste x-flipped pose” but the spine mirrors across y instead of the x axis.

Ok, so I wrote a piece of code that seeeeems to fix the problem with “post x-flipped pose”, just run it after performing “post x-flipped pose” and it should put your armature in the position you actually wanted, if it doesn’t play with the commenting. For example if you only “x-flip” the arms and then run this script you will want to comment out the Z-Axis flipping.

You will have to drop a key-frame on that bad-boy to get it holding in position.

here is the pastebin:

Did anyone else have this problem when they click “append hero”? :

Uninstall the add-on, make sure you have a the whole folder (the .py and the folders) as a zip file and re-install the add-on from the zip file - this puts the sub folders (inc. you missing mannequin) in the add-on folder.

Thanks! Solved my problem.

Hey, just found this, i dunno if this is still possible to use it for current version of and UE4, but i was following your video and after exporting the character, i was unable to import it in UE, i get an error right away, even before the import window.