Jump to content

[WIP][1.12.x] James Webb for Kerbal


bcink

Recommended Posts

5 hours ago, bcink said:

@Fengist You make a very valid point. Having not found any viable solution thus far I think that is the only realistic approach I can take without fumbling between clicking on deploy animation on multiple parts in quick succession (which wouldn't really make for an ideal in-game experience). Not looking forward to reworking the UV map but I haven't really done much with texturing on the two large segments anyways, so now is the time to fix it up right. Likely, will end up working this in 2056x2056 texture file...

You shouldn't need to rework the UV for unity.  You can import multiple models and multiple textures to make 1 part.

Link to comment
Share on other sites

2 minutes ago, Fengist said:

You shouldn't need to rework the UV for unity.  You can import multiple models and multiple textures to make 1 part.

No kidding? I thought I heard it was not ok to use multiple textures files on the same part O_o

Link to comment
Share on other sites

44 minutes ago, bcink said:

No kidding? I thought I heard it was not ok to use multiple textures files on the same part O_o

*Keep in mind that I am NOT known for making quality textures.  As I told another modder, if you give the users unique items and depth to their experience, they'll easily tolerate sub-quality textures*

I've never heard that and I don't see that it would make much difference if any.  You'll either have 1 texture, 1 part or multiple textures, 1 part. In either case, all the textures get loaded into ram.  Just the prop I linked above has 4 unique textures.  But I do some sharing of textures across models.  I'll do simple stuff like moving one model's unwrap to the left side of a texture and another model's unwrap to the right side and create one texture shared between 2 models.  That allows for both parts to have a high resolution texture without the ram expense of two high resolution textures. And the textures can all be different sizes. Plus, Unity will allow you to use any texture you import on any part.  It doesn't care.

Edited by Fengist
Link to comment
Share on other sites

Looks very good, also looks like it was all hand-painted, and goodness hand-unwrapped UVs. For some reason I always enjoyed that part but there are some low-cost (and high cost) solutions now for doing that in a couple clicks way better than I ever could, and it gets completely impractical for complex models. What tools are you using? There really should be some good options for relatively low-poly count projects like this.

E.G. don't try to do this by hand if you value your sanity, it's one of my 40k polygon mech models unwrapped, original is 4k.

EghaaTMl.jpg

Link to comment
Share on other sites

2 hours ago, vossiewulf said:

Looks very good, also looks like it was all hand-painted, and goodness hand-unwrapped UVs. For some reason I always enjoyed that part but there are some low-cost (and high cost) solutions now for doing that in a couple clicks way better than I ever could, and it gets completely impractical for complex models. What tools are you using? There really should be some good options for relatively low-poly count projects like this.

E.G. don't try to do this by hand if you value your sanity, it's one of my 40k polygon mech models unwrapped, original is 4k.

Thank you! I have been hand painting everything at this point now. That unwrap is wild.... I'm using blender for modelling and Photoshop for the textures. The UV unwrapping on this is bad enough I couldn't imagine doing one of those. Blender seems to be able to spit out OK UV unwraps but still requires a lot of manual adjusting time.

Edited by bcink
Link to comment
Share on other sites

1 hour ago, bcink said:

Thank you! I have been hand painting everything at this point now. That unwrap is wild.... I'm using blender for modelling and Photoshop for the textures. The UV unwrapping on this is bad enough I couldn't imagine doing one of those. Blender seems to be able to spit out OK UV unwraps but still requires a lot of manual adjusting time.

The hand-painting is quite good, I'd be pleased with it and I'm hard to please on these things as I go back to days when that was the only way to do things. And in some ways that's almost better for KSP, since it doesn't support all the fancy sub-maps, things that look amazing in MAX or elsewhere can lose much of their glitter when converted to KSP, whereas handpainting burns in your effects by default. You can see that with some of the "splash" screens modders do, then you see the parts in game and they don't like quite the same.

A few years ago there were just one or two UVW unwrap tools out there worth anything, now there are so many I can't keep track of them. I am lucky to have Flatiron which is the 155mm artillery of the bunch, so I can throw anything at it and 30 seconds later I have UVWs like the above. But there are lots of tools now that can do 90% of that at 1/5 the cost. Go do some googling on "UVW auto unwrap", there are at least three I know of with good reviews in the $40-$80 range.

Link to comment
Share on other sites

  • 2 weeks later...

Soooo I'm now trying to figure out how to get this sucker into the game..... I mean, I can get it in to the game, but I'm having some issues, of course :)  So I have two fbx files, the top section and the bottom section, which need to now combine in Unity to create one part using the two texture files? I slapped them together and got them into Kerbal but it's only playing the animation for the top section, not the bottom. Not really sure exactly how to resolve this just yet.

Also - the heatshields don't start their shape key animation from the fully folded up part, it's more like the base shape key is half way through that animation. It plays properly in the FBX preview window, but in the scene window and also once imported into the game it started at the base shape key point (also without animating due to above problem so possibly related I don't know?)

Help :D

Any suggestions?

Edited by bcink
Link to comment
Share on other sites

43 minutes ago, bcink said:

Soooo I'm now trying to figure out how to get this sucker into the game..... I mean, I can get it in to the game, but I'm having some issues, of course :)  So I have two fbx files, the top section and the bottom section, which need to now combine in Unity to create one part using the two texture files? I slapped them together and got them into Kerbal but it's only playing the animation for the top section, not the bottom. Not really sure exactly how to resolve this just yet.

Also - the heatshields don't start their shape key animation from the fully folded up part, it's more like the base shape key is half way through that animation. It plays properly in the FBX preview window, but in the scene window and also once imported into the game it started at the base shape key point (also without animating due to above problem so possibly related I don't know?)

Help :D

Any suggestions?

Which section is using the BlendShapes / ShapeKeys? 

(PartTools does not support this animation type last I tried, so the model will have to be loaded through an AssetBundle, and likely assigned to the part through plugin-code.  I -do- have BlendShape animated parts working in SSTU, but had to write up custom plugin code to actual load the models from the AssetBundles)

As to the 'defualt animation state' for blend-shape/shapekey animations -- I believe there is a box you can edit in Unity to change the currently displayed key.  Probably under the SkinnedMeshRenderer component, sadly I'm at work and don't have access to the Editor to say for certain.

Link to comment
Share on other sites

2 hours ago, Shadowmage said:

Which section is using the BlendShapes / ShapeKeys? 

(PartTools does not support this animation type last I tried, so the model will have to be loaded through an AssetBundle, and likely assigned to the part through plugin-code.  I -do- have BlendShape animated parts working in SSTU, but had to write up custom plugin code to actual load the models from the AssetBundles)

As to the 'defualt animation state' for blend-shape/shapekey animations -- I believe there is a box you can edit in Unity to change the currently displayed key.  Probably under the SkinnedMeshRenderer component, sadly I'm at work and don't have access to the Editor to say for certain.

Thanks, any info helps. It's just the heatshield layers folding and rising that use the shape keys

Link to comment
Share on other sites

This is at least comforting to see after 2 months...

qm5lvsp.gif

Indeed, I cannot get the bottom section to load in-game however. @Shadowmage, I see the shape-key starting position spots, but likely due to what you mentioned it will not load in game. Any kind of assistance you can offer or direction you can point me towards doing via the method you suggested? Thanks

Link to comment
Share on other sites

@bcink  My 'solution' to it was to write up a plugin to load the asset-bundle and fix missing texture/material links.  https://github.com/shadowmage45/SSTULabs/blob/master/Plugin/SSTUTools/SSTUTools/WIPModule/SSTUAssetBundleModelLoader.cs Feel free to use that code as a starting point for your own plugin / model-loader.  You could also use the full SSTU plugin if you would like, but there is a lot of other stuff in there -- probably easy enough to use it for testing.

The basic process goes:

  • In the unity editor, create a prefab from your finished model (drag it from the hierarchy view down into the project files panel, it will create a .prefab file). 
  • Mark that .prefab as belonging to an asset bundle. 
  • Build your asset bundle(s).  Only one model may be included in any given bundle (the bundle becomes the model file).
  • Rename the bundle extension to whatever you are using in your loading code (I use .smf, but it could use nearly anything). 
  • Add the asset-bundle to your mods' game-data folder.
  • Profit / Enjoy

The loading code that I use inserts the model into the GameDatabase models list after it is loaded, and it can be used in a part just like any other .mu model (through MODEL nodes at least).

Link to comment
Share on other sites

2 hours ago, Shadowmage said:

@bcink  My 'solution' to it was to write up a plugin to load the asset-bundle and fix missing texture/material links.  https://github.com/shadowmage45/SSTULabs/blob/master/Plugin/SSTUTools/SSTUTools/WIPModule/SSTUAssetBundleModelLoader.cs Feel free to use that code as a starting point for your own plugin / model-loader.  You could also use the full SSTU plugin if you would like, but there is a lot of other stuff in there -- probably easy enough to use it for testing.

The basic process goes:

  • In the unity editor, create a prefab from your finished model (drag it from the hierarchy view down into the project files panel, it will create a .prefab file). 
  • Mark that .prefab as belonging to an asset bundle. 
  • Build your asset bundle(s).  Only one model may be included in any given bundle (the bundle becomes the model file).
  • Rename the bundle extension to whatever you are using in your loading code (I use .smf, but it could use nearly anything). 
  • Add the asset-bundle to your mods' game-data folder.
  • Profit / Enjoy

The loading code that I use inserts the model into the GameDatabase models list after it is loaded, and it can be used in a part just like any other .mu model (through MODEL nodes at least).

Thanks so much. I'll try and digest it sll in some more detail when I get home tonight but it sounds like this will definitely get me going!! :)

I should still be able to use both the top and bottom sections as a single model with this method, what about any thought on both top/ bottom animations playing at the same time?

And thank you @SamBelanger!!

Link to comment
Share on other sites

1 hour ago, bcink said:

I should still be able to use both the top and bottom sections as a single model with this method, what about any thought on both top/ bottom animations playing at the same time?

This would depend on how you have built the sections and how you are combining them into the finished 'model'.  Getting them to both render on the same Part shouldn't be a problem as long as you can get them to load into KSP (just use two MODEL nodes with position/rotation setup appropriately).

Generally though KSPs code cannot play multiple animations from a single button, even if those animations have the same name and/or reside on the same transform/game-object.  It would require the animations have unique names, separate ModuleAnimateGeneric modules for each one, and the resultant GUI would end up with two buttons for the animations.  There -may- be ways to link up stock animation modules that I'm not aware of as I've used my own animation modules for quite some time.

How I would do it would be to import both of the 'sections' into the Unity editor underneath a single parent game-object; the parent object would be the model that you would export.  Create a legacy Animation in Unity, and add it to the root game object that you created.  Add keyframes for the blend-shape keys to the animation (this is how you animate the blend-shape stuff).  Add in the keyframes/keys for your other non-blend-shape based animations (unfortunately this means you can't use the animations that you exported from the modeling program -- you need to 'manually' redo the animations inside of Unity).  From there you would use the asset-bundle setup to export the single combined model as an asset bundle, and whatever plugin code to load it into the game.  It could then be referenced through a standard MODEL node in the part config, and everything else should just work.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...