ASSIMP non-Blender + Photoshop workflow

ASSIMP non-Blender + Photoshop workflow

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

Post Reply
MaDDoX
Posts: 77
Joined: 08 Jan 2006, 17:45

ASSIMP non-Blender + Photoshop workflow

Post by MaDDoX »

Hey guys, after some days struggling to understand how to get a 3D model from a non-Blender modeling package (tried Maya and Modo specifically) properly showing its texture in Spring, I finally nailed it. Most of my pain was due to information being scattered here and there, both in the main ASSIMP page and in the forums. To try and help others, I've decided to add a detailed walkthrough of the process to the Wiki. Please check it out and advise or edit it for any errors you spot. I'm also editing the main ASSIMP page for a couple outdated or obscure info/links.

https://springrts.com/wiki/3DModels:AssimpWorkflow
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: ASSIMP non-Blender + Photoshop workflow

Post by FLOZi »

Yay for wiki feeding.

IMO the existing Assimp page needs to be re-split so that the blender workflow is its own page again.

Please add your page to https://springrts.com/wiki/Category:3D_Models
MaDDoX
Posts: 77
Joined: 08 Jan 2006, 17:45

Re: ASSIMP non-Blender + Photoshop workflow

Post by MaDDoX »

FLOZi wrote:IMO the existing Assimp page needs to be re-split so that the blender workflow is its own page again.
Yeah, I think it's too long for a single page too. I just don't feel too comfortable moving other people's content around :)
Done, thanks for pointing that out.

I've also added some new info about tex2 and setting pivot points for DAE files, it was glaringly missing. Once I fully work out the rotation and translation correlation between LUS and the Y-up, Z-forward coordinate system I'll post it there as well, for completeness sake.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: ASSIMP non-Blender + Photoshop workflow

Post by gajop »

Some criticism:

This seems unnecessary, as you're technically covering all 3D modelling tools, right?
You can also use Blender for ASSIMP, but it won't be covered here.
What is the goal of this part?
II. In Photoshop
I think you should describe what you're doing in the title of each step. Creating DDS textures I suppose?
I'm also not sure this is necessary. Our LD games didn't have DDS textures and they worked fine, so this is more of an optimization step.
III. In Spring
I would split this last part into a separate wiki page. These are general purpose instructions on how to set models in Spring.
Methuselas
Posts: 17
Joined: 27 Nov 2017, 07:42

Re: ASSIMP non-Blender + Photoshop workflow

Post by Methuselas »

MaDDoX wrote:Hey guys, after some days struggling to understand how to get a 3D model from a non-Blender modeling package (tried Maya and Modo specifically) properly showing its texture in Spring, I finally nailed it. Most of my pain was due to information being scattered here and there, both in the main ASSIMP page and in the forums. To try and help others, I've decided to add a detailed walkthrough of the process to the Wiki. Please check it out and advise or edit it for any errors you spot. I'm also editing the main ASSIMP page for a couple outdated or obscure info/links.

https://springrts.com/wiki/3DModels:AssimpWorkflow

Ooh, so basically Spring Engine will use a Collada container? I, like you, exclusively uses Maya. Can, you, by chance explain to me how animations work in the engine?
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: ASSIMP non-Blender + Photoshop workflow

Post by Anarchid »

Ooh, so basically Spring Engine will use a Collada container
Spring *already* uses Collada.
Can, you, by chance explain to me how animations work in the engine?
You pretty much write a program (called a "lua unit script") to move pieces of the model in response to various events.

The model itself has to be arranged in a parent-child hierarchy for this to work (no armatures/skeletons and no skinning).

Here's an example of such program. Here's the documentation. If you can stomach working with blender, you can use this addon to somewhat split the programming and animating tasks (you will still have to do the programming bits, but invoking animations becomes as easy as "PlayAnimation('die')".
Methuselas
Posts: 17
Joined: 27 Nov 2017, 07:42

Re: ASSIMP non-Blender + Photoshop workflow

Post by Methuselas »

Anarchid wrote: Spring *already* uses Collada.
Yeah, I figured that out, last night from reading some of the Docs. I stumbled across some of the links you posted last night.
You pretty much write a program (called a "lua unit script") to move pieces of the model in response to various events.

The model itself has to be arranged in a parent-child hierarchy for this to work (no armatures/skeletons and no skinning).

Here's an example of such program. Here's the documentation. If you can stomach working with blender, you can use this addon to somewhat split the programming and animating tasks (you will still have to do the programming bits, but invoking animations becomes as easy as "PlayAnimation('die')".

OH! Okay, now I get it. I am familiar with luascripts, but never used them for animation. The Animations, though, work similar to the MC2 engine, except for the fact it has ASE containers for animations, not luascripts.

1. Now, concerning parent-child hierarchy, is there a root locator, which everything is parented under, or are all the pieces just parented under the locator/helper object, separately? I may have a work around that would allow you to use IK rigs to animate with using parent-child hierarchy, but there are two caveats: 1. I've only tested it in Maya and Max, using burned animations, to get rid of the bones and constraints and 2. It only works with vehicles and mech-style models.

2. Are the animation files (Walk, Run, Die, Hit Left, etc) luascripts or DAE containers with the animations embedded?

3. Looking at the example luascript you gave me, I'm noticing that it has includes for pieces. Is it possible to add multiple "gun pieces" (weapon points) or toes? Looks like it's possible, but would it break other scripts?

4. Could you possibly point me to one of the animation luascripts, so I could dissect it? Walk or Run would be best.

5. Do models require Z-Axis up or Y-Axis? [Truncated] MaDdox's wiki article told me what I needed to know.


Oh and please don't take my dislike of Blender to be that I wouldn't use it. I started out using Cinema4D on my Amiga, then moved to Max and finally, Maya, for better character animations. I've got *NO* problem using an application to speed up workflow and from what I read, using your script (which I've already downloaded. ;P) would work better than having to hand code each part movement, by hand.
MaDDoX
Posts: 77
Joined: 08 Jan 2006, 17:45

Re: ASSIMP non-Blender + Photoshop workflow

Post by MaDDoX »

Hi Methuselas. The first 3D package I used was Imagine on the Amiga, then I started on Lightwave beta (there was an e-mail list where the devs actually replied back then!) and stayed in it for more than a decade. These days I use Maya and Modo for almost everything, still visiting Lightwave from time to time.

So, back to your point, there are some things I've already learned about animating in the Spring engine (using LUS, Lua Unit Script) and some stuff I'm still figuring out. Once I have a complete workflow - and probably a tool as well - I'll write a Wiki page on it, so feel free to share anything new you find.

1. Maya default DAE exporter sucks, and Spring won't load anything spit from it. I export fbx from Maya and import into Modo, then export to DAE. It works fine. I haven't tried other DAE exporters/plugins, highend3d.com has a bunch so if you try them and have any luck with those please share the news.
2. Custom pivots for objects don't work. What I'm having to do (painfully) is adding a null object / locator, move it to the desired pivot position (never zeroing out its coords / freezing position), then parent the actual mesh object to it. The null object is what should be rotated by LUS. That obviously makes the hierarchy much bigger and cumbersome to use than it should, and I'm not sure if there's a workaround for that - maybe using joints? Joints themselves seem to export fine, it's just the actual weight blending/mesh deformation which isn't supported by Spring.
3. There's no support for ease-in, ease-out, just linear move or rotation, so baking any sort of organic animation is a must. Making such an exporter for Maya using python is not too hard, especially for a simple 'snapping' version, I intend to work on it early next year - unless someone else tackles it first, ofc :)
4. Separate animation clips should be read from a single LUS file, although you can include separate lua files in a single "main" one as you'd do with any lua script.

Good luck!
Methuselas
Posts: 17
Joined: 27 Nov 2017, 07:42

Re: ASSIMP non-Blender + Photoshop workflow

Post by Methuselas »

MaDDoX wrote:Hi Methuselas. The first 3D package I used was Imagine on the Amiga, then I started on Lightwave beta (there was an e-mail list where the devs actually replied back then!) and stayed in it for more than a decade. These days I use Maya and Modo for almost everything, still visiting Lightwave from time to time.

So, back to your point, there are some things I've already learned about animating in the Spring engine (using LUS, Lua Unit Script) and some stuff I'm still figuring out. Once I have a complete workflow - and probably a tool as well - I'll write a Wiki page on it, so feel free to share anything new you find.
I *LOVED* Imagine3D. I never really got into Lightwave. I stuck mostly with Cinema4D (it was what I had access to, at the time.) but I also played with Aladdin3D. I was actually given an updated copy of Aladdin about 10 years ago, by the developer. Unfortunately, by then, I had all but dropped out of the Amiga scene. My 500 is still languishing in my closet. I need to get a new case for it. It tried to commit suicide a little over a year ago, falling off a top shelf.
1. Maya default DAE exporter sucks, and Spring won't load anything spit from it. I export fbx from Maya and import into Modo, then export to DAE. It works fine. I haven't tried other DAE exporters/plugins, highend3d.com has a bunch so if you try them and have any luck with those please share the news.
I haven't even looked at exporting yet. I just got the engine installed yesterday, but didn't realize it was simply a build of the engine. I downloaded Zero-K to see how it functions, but it appears I need to actually read the code instead (which is not my forte.) Maybe I'll bug my wife to look at the code, since she's a software developer. XD
2. Custom pivots for objects don't work. What I'm having to do (painfully) is adding a null object / locator, move it to the desired pivot position (never zeroing out its coords / freezing position), then parent the actual mesh object to it. The null object is what should be rotated by LUS. That obviously makes the hierarchy much bigger and cumbersome to use than it should, and I'm not sure if there's a workaround for that - maybe using joints? Joints themselves seem to export fine, it's just the actual weight blending/mesh deformation which isn't supported by Spring.
Joints are EXACTLY what you want to do. The Local Rotation Axis of Locators is ALWAYS set to 0,0,0 coordinates (ie, world axis) From what I read, Spring uses it's own rotation results.

1. Build your skeleton. Make sure the LRA axis of each bone is the same. (If you don't know how to do this, I can walk you through manually adjusting them to match. It's really simple. This is a CYA thing.)

2. Parent a Locator to each bone.

3. Parent the mesh to each locator.

4. Rig the Skeleton to your heart's content. (Avoid using HumanIK right now, as it requires bones for hands, but if I am correct in my assumptions, the extra bones won't matter to the Spring Engine. I have no way to adequately test animations in the Engine, as I have no build to allow me to do so. )

5. Export the animations and when you do so, BURN the animations, but without the bones. The Locators/Mesh will still move and should automatically keyframe themselves.

This is basically the same format I used to make new animations for Mechcommander Omnitech. Unfortunately, the developer of MCO went a direction I didn't want to follow, so they were only used for my own work.
3. There's no support for ease-in, ease-out, just linear move or rotation, so baking any sort of organic animation is a must. Making such an exporter for Maya using python is not too hard, especially for a simple 'snapping' version, I intend to work on it early next year - unless someone else tackles it first, ofc :)
4. Separate animation clips should be read from a single LUS file, although you can include separate lua files in a single "main" one as you'd do with any lua script.

Good luck!
If you get around to writing a python script, let me know. I can help you with bug testing.
Methuselas
Posts: 17
Joined: 27 Nov 2017, 07:42

Re: ASSIMP non-Blender + Photoshop workflow

Post by Methuselas »

MaDDox,

Since you've already put units in game, send me one of your models as an FBX (I use Maya 2014, since I'm still using Max 2014), with each part labeled correctly for the engine. I'll build a basic skeleton rig with IK for it. Do a quick animation and import it to see if my theory is correct. If it is, all we would need are a humanoid skeleton, chicken walker skeleton and a vehicle rig (well, two rigs one wheeled/track and one VTOL/rotor - I would need this last one.)
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: ASSIMP non-Blender + Photoshop workflow

Post by Anarchid »

I wasn't visiting the forums for a while, but i guess late is better than never.
I may have a work around that would allow you to use IK rigs to animate with using parent-child hierarchy
That would be awesome if it works!
2. Are the animation files (Walk, Run, Die, Hit Left, etc) luascripts or DAE containers with the animations embedded?

If you're using anything similar to what the blender addon puts out, they are Lua files with animation data in Lua tables. If you go by what most people in Spring do instead, these animations are typically Lua functions.
3. Looking at the example luascript you gave me, I'm noticing that it has includes for pieces. Is it possible to add multiple "gun pieces" (weapon points) or toes? Looks like it's possible, but would it break other scripts?
Sure! Most Spring games have units with multiple guns, multiple weapons systems, and even multiple weapons systems with multiple guns.
4. Could you possibly point me to one of the animation luascripts, so I could dissect it? Walk or Run would be best.
You can see the Walk animation for ZK's Glaive here, as a Lua function in the same file where the "code" of the script lives.

Alternative approach (with blender addon) goes with animation definitions like this (exported from this file) which are then included into the script file like this and invoked like this.

I imagine if there's ever a Max or other proprietary 3d-suite addon to export animation scripts for Spring, it would have a reasonably similar structure.
Oh and please don't take my dislike of Blender to be that I wouldn't use it
Nice! If you end up using it in any way i guess i'll gather together enough motivation to finish some long-standing bugs and lacking features (like exporting for arbitrary euler orders).
Post Reply

Return to “Art & Modelling”