Jump to content

0.15 PartTools - New model tools


Mu.

Recommended Posts

So time to talk about models and the much hyped hierarchical model format, rather suspiciously named '.mu'

The old DAE importer was a bit wrong. It was messy to use and did weird things like flatten the heirarchy out. Also it only imported static meshes. When you\'re dealing with a system like Unity we dont want you, or ourselves, limited. My aim was to create a WYSIWYG part exporter for our artists so that we could be certain what went in came out the same. With Unity as a backbone i\'ve created us simple exporter tool. It comes as a unitypackage and you can import it into any existing project. Should work on non-pro versions too.

Overview

To use it you would create a PartTools gameobject in a scene, add/setup your model as a child of the PartTools object, then click Write. It automatically writes the hierarchy and any textures into the given directory ready to be playtested.

You can write each PartTools object individually or use the bulk exporter. This works on the entire project currently. Every PartTools prefab in the project will get written to its respective directory. Will possibly expand these features a little in the future.

Currently the only supported filename for .mu files is 'model.mu'. Just place it in the directory with the part.cfg and it will be looked for as priority over any other models.

How-to

1. Create a new GameObject in a scene and add the KSP/PartTools component to it. This GameObject becomes the \'model\' parent when it is loaded into the game, its name is irrelevant.

2. Drag and drop your model into the scene and parent it to the PartTools GameObject.

3. Assign KSP materials to your model. This version of PartTools only supports the included shaders.

4. Set up PartTools making sure that the directory is set correctly.

5. If your materials use formats other than JPEG or PNG then you must convert the textures.

6. Press Write!

Meshes

Standard meshes and skinned meshes are supported along with tangents and vertex colours. You may also use meshcollider components tho must usually ensure isConvex is ticked. Submeshes are supported.

Materials and shaders

You may only use shaders from the list provided with PartTools. Shared material references are preserved. Multiple materials on a renderer are also supported.

Textures

Currently there are three types of texture format supported by KSP; JPEG, PNG and MBM. You may not use cube maps. I do want to ditch MBM in favour of something user-editable but we\'re stuck with it for a few weeks. At least you wont have to convert everything manually.

If you tick 'Convert Textures' then all textures are converted to MBM format. It is often a safer route to leave convert ticked.

Animations

Animation components can be written along with the hierarchy so you can force an animation to play forever or use them from script (part.FindModelAnimator is useful). Transform/bone animations are supported along with Light and Material animations.

Supported components

MeshFilter, MeshRenderer, SkinnedMeshRenderer

MeshCollider, SphereCollider, CapsuleCollider, BoxCollider

Animation (Lights, Materials & Transforms)

Light

Supported shaders

KSP/Diffuse

KSP/Specular

KSP/Bumped

KSP/Bumped Specular

KSP/Emissive/Diffuse

KSP/Emissive/Specular

KSP/Emissive/Bumped Specular

KSP/Alpha/Cutoff

KSP/Alpha/Cutoff Bumped

Link to comment
Share on other sites

So, we still have the ability to use .dae and .obj files or will we have to move over to the new .mu system, and that .mu files just get loaded first?

Everything is still backward-compatible, the new system just gives you better options.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry, I did not understand anything.

What do I have to do with this KSP PartTools 015.unitypackage file I just downloaded? Where do I have to install it? What is this Unity thing? Will I still be able to use 3DS Max for my 3d models?

Thanks

Maraz

Link to comment
Share on other sites

Sorry, I did not understand anything.

What do I have to do with this KSP PartTools 015.unitypackage file I just downloaded? Where do I have to install it? What is this Unity thing? Will I still be able to use 3DS Max for my 3d models?

Thanks

Maraz

We may still work as we did before: model in 3DS Max and export as .DAE. New features (like bump-mapping) won\'t be supported.

Alternatively, we may install Unity (it\'s free), learn how to use it =P, and use a package supplied to convert those .DAE models into new format, with all new fancy features.

But I\'ve still no luck with it :(

Link to comment
Share on other sites

THanks for explanation, still I do not understand whether Unity is a 3D modelling tool. I\'ve been working with 3DS Max for years now, and still I do know 50% of it, and it\'s out of question that I start learning another tool. I hope that models made in other tools can work with Unity... :o

Maraz

Link to comment
Share on other sites

I could import a MAX model, it seems to me that I made all the steps, I obtained the .mu and .mbm files, but they are not displayed in game. The object is present in the VAB but nothing is displayed. Please help! A sample scene, with a simple object, could be really useful.

Thanks

Maraz

Link to comment
Share on other sites

Are you sure that nothing is displayed?

I apparently had the same issue, but this was due to the gameobject and the model not being in the same place.

The GameObject is defaulted to 0,0,0, so you should put your model at the same place, and then parent it.

Hope that helps.

Link to comment
Share on other sites

Are you sure that nothing is displayed?

I apparently had the same issue, but this was due to the gameobject and the model not being in the same place.

The GameObject is defaulted to 0,0,0, so you should put your model at the same place, and then parent it.

Hope that helps.

You are right, thanks. That was part of the problem, now I have solved it.

But now I have two other problems:

- scale: the object is rendered as large as an ant :), at first i thought it was a particle of dirt on my monitor. But the scale in the MAX model was correct (meters). I could try and increase the scale, but how much? 100x ? 1000x?

- I can see the object in the object menu on the left (because it has auto-scaling) and I can see that the node collider is rendered as is was a visible object. I have set it in Unity to Mesh Collider and unchecked the box Mesh Renderer.

Maraz

Link to comment
Share on other sites

Set the scale to 1 in the part.cfg if you modeled the part at this scale in Max.

Also, when importing the asset in Unity, delete the node_collider from the Hierarchy on the left, and in your part\'s Mesh Collider, click on the circle on the right of the Mesh box, and choose your collider.

My problem has probably nothing to do with Unity itself, but how can I set multiple modules to one part? Is it possible from within the part.cfg?

Link to comment
Share on other sites

Set the scale to 1 in the part.cfg if you modeled the part at this scale in Max.

Also, when importing the asset in Unity, delete the node_collider from the Hierarchy on the left, and in your part\'s Mesh Collider, click on the circle on the right of the Mesh box, and choose your collider.

Thanks for these tips. The scale is 1 already, though. Maybe there was a mismatch metres/millimetres when importing from MAX tro Unity ?...

My problem has probably nothing to do with Unity itself, but how can I set multiple modules to one part? Is it possible from within the part.cfg?

This thread can be helpful:

http://kerbalspaceprogram.com/forum/index.php?topic=11734.msg195012;boardseen#new

You can now have multiple modules for the same part.

Bye

Maraz

Link to comment
Share on other sites

Set the scale to 1 in the part.cfg if you modeled the part at this scale in Max.

Also, when importing the asset in Unity, delete the node_collider from the Hierarchy on the left, and in your part\'s Mesh Collider, click on the circle on the right of the Mesh box, and choose your collider.

Thanks a lot.

I solved the collider problem as you said.

Then I had to input a scale factor of 100x and a rotation of 180° around the Y axis to have the model displayed correctly in game.

Now the model in game is displayed but the normal map is not rendered.

Instead it is rendered correctly in the Unity window.

Probably I made something wrong when setting the shader. I chose the 'Bumber Diffuse' one, that has a Normal map. This my Unity setup, could someone help ?

unityn.th.jpg

Thanks

Maraz

Link to comment
Share on other sites

Now I found probably the correct shader, that is named KSP/Bumped.

Effect is now showed in game, but bumps appear to be inverted in up/down direction, compares to those showed in 3DS Max.

Can someone help?

Thanks

Maraz

Link to comment
Share on other sites

I\'ve been trying to add the PartTools component to the GameObject, but I keep getting an error that says -

Can\'t Add Script

Script PartTools has not finished compilation yet.

Link to comment
Share on other sites

Hi, I\'d like to know if there is any other way to use the new system with software other than Unity3D, as I just managed to install it but it\'s requiring me to register for a one time only 30 day trial.

I have not progressed beyond that screen as I am reluctant to start using a product that may expire in 30 days and then cost me $1500 to 'upgrade', this point may be moot anyway as Unity3D may not work correctly or at all in Wine.

The demo version may well keep working after the 30 days with a nag screen, but continuing to use it after that point isn\'t strictly legal because of the terms of use you agree to when installing.

I understand the game will maintain backwards compatibility with the DAE files for the time being, but I have also recently found it is not possible to do something as simple as a texture change without using Unity3D.

What I (and I expect others as well) would like is a plugin for blender that can handle exporting to the new file format if this is possible.

I, like many people who play KSP, do not have $1500 to spend on a developer tool I may only use for a few addons.

Link to comment
Share on other sites

Hi, I\'d like to know if there is any other way to use the new system with software other than Unity3D, as I just managed to install it but it\'s requiring me to register for a one time only 30 day trial.

I have not progressed beyond that screen as I am reluctant to start using a product that may expire in 30 days and then cost me $1500 to 'upgrade', this point may be moot anyway as Unity3D may not work correctly or at all in Wine.

The demo version may well keep working after the 30 days with a nag screen, but continuing to use it after that point isn\'t strictly legal because of the terms of use you agree to when installing.

I understand the game will maintain backwards compatibility with the DAE files for the time being, but I have also recently found it is not possible to do something as simple as a texture change without using Unity3D.

What I (and I expect others as well) would like is a plugin for blender that can handle exporting to the new file format if this is possible.

I, like many people who play KSP, do not have $1500 to spend on a developer tool I may only use for a few addons.

Unity has a free version, even if it doesn\'t work on Wine, you won\'t have any problems.

Link to comment
Share on other sites

I just installed this version which is listed on the site as the free download, and it is this version that has the one time only, 30 day trial.

Here is the screen the 'free' version of Unity displays.

zZwcv.jpg

And here is the EULA in the installer.

itm81.jpg

From the Unity3D free version End User Licence Agreement on the website.

6. Term.

If you have licensed a trial version of the Software, the license granted under this Agreement will remain in effect for a period of 30 days, unless earlier terminated in accordance with this Agreement. For all other versions of the Software, the license granted under this Agreement will remain in effect unless earlier terminated in accordance with this Agreement. You may terminate the license at any time by destroying all copies of the Software in your possession or control. The license granted under this Agreement will automatically terminate, with or without notice from Unity, if you breach any term of this Agreement. Upon termination, you must at Unity’s option either promptly delete and destroy or return to Unity all copies of the Software in your possession or control.

The 'Free' version of Unity3D is trialware with a 30 day limit, when you first run the software you have to register for a one time only licence, after 30 days you have to uninstall and stop using the software or pay $1500 for the desktop edition of Unity3D.

Continuing to use Unity3D after 30 days without paying for it is in breach of the EULA you agree to when registering the software, potentially putting users at risk of legal action against them.

Continuing to use a product after your right to use it has expired without paying for it is theft, it\'s like keeping a hire car after the lease expires.

If I\'m wrong about this I\'d really like to know, as I want to make mods using the new system and a lot of people who are making mods want to continue to do so, maybe Squad should have their legal team look at this as most players aren\'t going to pay much attention to it, as they will ignore EULA\'s and think it doesn\'t apply to them.

Link to comment
Share on other sites

I just installed this version which is listed on the site as the free download, and it is this version that has the one time only, 30 day trial.

Here is the screen the 'free' version of Unity displays.

zZwcv.jpg

And here is the EULA in the installer.

itm81.jpg

From the Unity3D free version End User Licence Agreement on the website.

6. Term.

If you have licensed a trial version of the Software, the license granted under this Agreement will remain in effect for a period of 30 days, unless earlier terminated in accordance with this Agreement. For all other versions of the Software, the license granted under this Agreement will remain in effect unless earlier terminated in accordance with this Agreement. You may terminate the license at any time by destroying all copies of the Software in your possession or control. The license granted under this Agreement will automatically terminate, with or without notice from Unity, if you breach any term of this Agreement. Upon termination, you must at Unity’s option either promptly delete and destroy or return to Unity all copies of the Software in your possession or control.

The 'Free' version of Unity3D is trialware with a 30 day limit, when you first run the software you have to register for a one time only licence, after 30 days you have to uninstall and stop using the software or pay $1500 for the desktop edition of Unity3D.

Continuing to use Unity3D after 30 days without paying for it is in breach of the EULA you agree to when registering the software, potentially putting users at risk of legal action against them.

Continuing to use a product after your right to use it has expired without paying for it is theft, it\'s like keeping a hire car after the lease expires.

If I\'m wrong about this I\'d really like to know, as I want to make mods using the new system and a lot of people who are making mods want to continue to do so, maybe Squad should have their legal team look at this as most players aren\'t going to pay much attention to it, as they will ignore EULA\'s and think it doesn\'t apply to them.

Just go to the Unity store, select the non-Pro version of Unity, register it and you will have a lifetime license of the standard version, no cost.

It is a bit weird you have to 'buy' the free version, but that is the way it works. You will receive a license number to use with it after that.

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...