Jump to content

Can't get Unity Part Tools to work!


Recommended Posts

Help. I tried making my first part. Yea.

I get a NullReferenceException when I load. Help?

What I did was simply create a cylinder, 24 sides and assigned it a blue material. I then created another cylinder, 12 sides, named node_collider and also assigned it the blue material.

What gives? (Not using unity yet, I better get a working model first.)

Attached are the DAE and blend files.

Also here is the config (if it\'s the problem [yes I know I ripped it off the Bace Kit, but it was a random folder I clicked.])


// Kerbal Space Program - Part Config
// FL-T400 Fuel Tank
//

// --- general parameters ---
name = basekitFuelTank
//module = FuelTank
module = Strut
author = NovaSilisko

// --- asset parameters ---
mesh = fueltank.dae
//scale = 0.1
scale = 0.1
texture = fueltank.png
specPower = 0.1
rimFalloff = 3
alphaCutoff = 0

// --- node definitions ---
//node_stack_top = 0.0, 1.59, 0.0, 0.0, 1.0, 0.0
//node_stack_bottom = 0.0, -1.59, 0.0, 0.0, 1.0, 0.0

node_stack_top = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0

// --- editor parameters ---
cost = 400
category = 0
subcategory = 0
title = BACE Construction Co. - Multipurpose Fuel Tank
manufacturer = BACE Construction Co.
description = A cheap, easy-to-build fuel tank - designed for deorbit burns and landing.
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,0,0

// --- standard part parameters ---
mass = 1.15
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.3
angularDrag = 2
crashTolerance = 8
breakingForce = 80
breakingTorque = 80
maxTemp = 2900

// --- fuel tank parameters ---

//fuel = 100.0
//dryMass = 0.5
//fullExplosionPotential = 0.7
//emptyExplosionPotential = 0.1

Link to comment
Share on other sites

Hi requimrer, did you remember to do the UV unwrap?

Also I\'m not sure if materials will show up in-game, at least I never figured out how to do it, you still need a material but I think you have to have a texture if you want to see anything other than black, but whether you use a texture or not you still need the UV map.

Hope this helps, or I\'m totally wrong :)

Link to comment
Share on other sites

Yea, I did watch the tutorial. He said to select the cylinder, minus the top and bottom, then click UV unwrap. The problem is, I can\'t deselect the top nor bottom! In the video, the base of his cylinder looks like a bunch of pie pieces, triangles. Mine just looks like a whole circle. Can\'t select nuthin!

I\'m using the latest blender for OSX.

Link to comment
Share on other sites

Did you press Tab to go to edit mode?

Once there you should see the dots marking the virtices, find the face select mode button near the bottom of the screen and click it.

Then press 'A' to select all if they are not already selected, and then shift+click to deselect faces.

But really, you can UV unwrap the whole thing, it wont hurt.

Edit:

I think this one can be classed as solved :)

Link to comment
Share on other sites

Maybe not. Unity has other plans. Gah.

So I figured out that first problem, got the part to load in-game and all, so I decided I would go the Unity way, just to give things a try.

I followed the instructions that Mu posted;

1. Place .dae and texture into Assets folder.

2. Create new empty GameObject.

3. Assign the Part Tools component to that GO.

4. Drag the .dae over the GO; parented, I suppose?

5. Press write on Part Tools.

I get a model.mu no problem, the game loads it no problem as well... With a small hitch.

'Hierarchy model: Model should have a collider!'

It appears in the VAB, however the icon is very much offset. I can place it in the scene but I cannot click or otherwise select it afterwards.

I think that somehow the node_collider mesh got screwed up? But then KSP shouldn\'t be able to load it, like with the old DAE.

I did nothing else, didn\'t change any options or anything.

What?

EDIT: I didn\'t do any normal map, could that be the problem?

Link to comment
Share on other sites

You don\'t need a normal map for the unity part tool to work but what you do need to do is to tell unity that your node_collider is a collider.

The old DAE importer automatically turned anything named 'node_collider' into a mesh collider, but in the new system you need to assign that manually by doing this:

Click your node_collider

Go to Component -> Physics -> Mesh collider

Once you have told unity that your node_collider is a mesh collider all you have to do is to delete the Mesh render component from it to make it invisible. Right click Mesh render in the right hand side menu and select 'remove component'

One of the beauties of the new system is that you can have more than just one collider, so if you feel that you need more than one you can simply add new ones either by making a new mesh in your 3d editing software or adding preset unity colliders directly in the unity editor.

Hope that helps.

Link to comment
Share on other sites

Oh thanks man! I forgot how Unity handles things. Three more questions, you guys are awesome!

1. The part icon in the VAB is still off-centre, I set positions of both the GameObject and my Test2 model to 0, 0, 0. ?

2. How do I generate a normal map? The NVIDIA normal map filter that Tosh (Was it?) used in his tutorial post isn\'t available for mac. I do have photoshop though.

3. If I do get the normal map, how do I apply it? The aforementioned tutorial says nothing about that.

EDIT:

Also, how do I make use of the engine heating thingy effect?

Thanks guys, I love this place :P

Link to comment
Share on other sites

1. Unless your part is incredibly large keeping it on the scene origin and setting the coords to 0,0,0 should make a correct part icon.

2. There are two ways to generate a normal map, from texture or from model.

A normal map filter can generate a normal map from a texture, I\'ve never tried doing this but I understand that the result isn\'t always all that great.

The other option is generating a normal map from a high-poly mesh, this is done in your 3d software Crazy long url for a youtube search

3. C7 shows how to apply a normal map in his part tool tutorial

Extra question. CBBP did a write up on this: http://kerbalspaceprogram.com/forum/index.php?topic=13450.msg205780#msg205780

Although iirc you can\'t use both a normal and an emissive map at the same time.

Link to comment
Share on other sites

The part is not large, it is of 12/24 sides, depth 1 and radius 0.5. Exactly to spec, nothing wrong. It appears perfectly fine if I don\'t go through unity.

I set the location of anything I could find in the scene to 0, 0, 0. I also deleted the 'Main Camera', although past experiences with unity don\'t need a camera, iirc.

Curse this new thing!

(It\'s pretty good actually)

Link to comment
Share on other sites

The part is not large, it is of 12/24 sides, depth 1 and radius 0.5. Exactly to spec, nothing wrong. It appears perfectly fine if I don\'t go through unity.

I set the location of anything I could find in the scene to 0, 0, 0. I also deleted the 'Main Camera', although past experiences with unity don\'t need a camera, iirc.

Curse this new thing!

(It\'s pretty good actually)

I had this problem when the GameObject was not located in 0,0,0.

Please also check that the pivot of your mesh and collider node, in Blender (or whatever 3D program you are using) is the same for both, and is located in 0,0,0 .

Maraz

Link to comment
Share on other sites

I had this problem when the GameObject was not located in 0,0,0.

Please also check that the pivot of your mesh and collider node, in Blender (or whatever 3D program you are using) is the same for both, and is located in 0,0,0 .

Maraz

I assure you, anything and everything that has positional data has been changed to 0, 0, 0. Seriously. Have a gander!

Thanks for the trouble.

Link to comment
Share on other sites

Another hitch. Bad things man.

I was checking out the part in-game, and it seems that the textures have a slight problem...

When creating the cylinder, I said before that I didn\'t get the pie-shaped top of the cylinder. Turns out...

Image 1 is what I have in blender, after I did 'Triangulate Faces' (or something). Triangles yes, but not as I would like them...

Image 2 is in-game, where I have simply painted alternate sections of the cylinder green and yellow, but the ends of the cylinder... What can I say? Also worrying is that wavy-jagything.

Image 3 is another bug: When selected, the tops and bottoms become black. I suspect this is due to improper UV mapping, but my current UV map is in image 4; I can\'t map the top and bottom.

Gah.

Link to comment
Share on other sites

Ah. Now you mention the cap type... It was defaulted at N-gon. WHY, WHY YOU STUPID N-GON, YOU HAVE COME TO RUIN MY LIFE!

But after setting it to 'Triangle Fan', things turn out as expected. Now, about that off-centre icon... Because I would really like to get emissive textures on future products...

Man I love this place and these people!

Link to comment
Share on other sites

N-gons were added in blender 2.63, and since that update the default option when creating cylinders is to have N-gon ends.

There is however no reason to not use them in situations like this, KSP shouldn\'t have any issues triangulating them on import.

And the reason your ends are black is indeed due to the UV-map, chances are that you removed the old faces and replaced them with new ones and forgot to unwrap the new ones. Hitting 'constrain to image bounds' in the UV menu helps you keep the UV-map within it\'s bounds by the way.

Link to comment
Share on other sites

Can\'t really help you with that, I\'ve had parts get offset icons but reimporting the assets into unity and redoing the write always fixed it. I never managed to figure out what was causing it.

Link to comment
Share on other sites

Bah. I can\'t get anything working now. :/

I just modeled a semi-complex fuel tank. It loads in-game as usual, but sigh, I can never seem to get the UVs right, ever. I joined all my objects in blender into one, which may or may not be a mistake. But I only did that because I couldn\'t get all the individual UV maps to join into one. Either way, I applied a standard grey material to the tank, and the texture is also grey. In fact, there\'s so much grey the whole texture.png is grey.

But alas...

I just changed the nodes slightly and got it to attach in-game... The texture when placed, and in the part list, is perfectly fine. However... When selected, the green overlay is purple and the other one is cyan (from the picture).

On a sidenote, what do you guys think about my design style? Not to match stock, for sure.

PS: Can a mod move this to the modeling and texturing discussion sub forum? Thanks.

Link to comment
Share on other sites

Hi requimrar, topic moved as requested.

That is an interesting style, it makes me think of Buckrogers, rayguns and big headed aliens.

You can UV unwrap the parts individually and just tweak each ones UV map, it might be clearer that way at least it is for me, not having the UVmaps combined isn\'t a problem as you can assign the same material and texture to all the parts, it\'ll still only load it once.

Link to comment
Share on other sites

Hi requimrar, topic moved as requested.

That is an interesting style, it makes me think of Buckrogers, rayguns and big headed aliens.

You can UV unwrap the parts individually and just tweak each ones UV map, it might be clearer that way at least it is for me, not having the UVmaps combined isn\'t a problem as you can assign the same material and texture to all the parts, it\'ll still only load it once.

[/quote

Thanks man. Yea, I can map them separately, but how do I combine them at the end to make a single .png texture for KSP? I\'m not using unity until I can solve the off-centre part icon problem. Also the funny colours... IIRC the Intrepid parts from JordanCox had those, (certain ones anyway).

Thanks for the design criticism on the part design.

Link to comment
Share on other sites

Well I\'m not using Unity either as it doesn\'t work for me, but the way I did the thrusters for Tosh\'s little buggy was I made one texture that had everything I wanted on it, and just mapped various bits of the mesh to that, I don\'t think there is multiple texture sopport though I may be wrong on this.

All texturing I have seen has tried to stuff everything into one image.

Link to comment
Share on other sites

The way I combine Uv maps is to export them as separate images and then open them as layers in a 2d editing software and save that. The actual Uv coordinates are saved in the mesh file so the Uv maps don\'t have to be combined for them to 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...