Jump to content

I want to shoot myself in the


Recommended Posts

Well, I used the search funcion, I read all the tutorials, I downloaded all the needed tools, I already had the skill from before, I was a calm and reflexive individual before this, but now I'm blind, not because of accidentally looking at the sun, but because I'm enlightened by my own rage.

I'll proceed to explain in chronological order:

•I made my asset in 3Ds Max 2010.

•I made sure to center it as every freaking tutorial said

•Textured it by unwrapping

•Exported it to FBX with Z-up as the (recently closed) 3ds max tutorial said

•Opened a new project in Unity

•Imported the model following the UNITY AND KSP tutorial (setting scale factor, creating colliders and lighting UVs)

•Watched the scale factors and all that jazz (my part is 1m diameter at 1 unit = 1 meter on 3ds max)

•Added my node_collider box created in 3dmax as a mesh collider to my main mesh, clicking convex of course.

•Created empty gameobjects to position my node_stack_top and bottom and thrustTransform

•Exported the model to .mu format with the texture converted to mbm (also tried png)

•Grabbed the .mu and sent it to my parts folder at ksp folder

•Created the CFG taking others as a base, but putting my own coordinates for the nodes and watching carefully any other possible mistake, there were none to be seen.

AND ALL I GET IS AN INVISIBLE USELESS PART AND AN ENGINE FX THAT IS ON EVEN IN THE VAB. I seriously want to shoot myself down there so that it doesn't kill me but it hurts enough to forget this painful experience.

Any help appreciated, if you need any additional data just ask.

Link to comment
Share on other sites

Hmm, I didn't know you can put gameobjects for attach points, I write them down in .cfg myself. I also don't use the node_collider (isn't node_collider obsolete?), but I pick an object and add convex mesh collider (if it is invisible, collider-only object then remove rendering component). Everything else is the same. And I never made engines.

Are the collisions there, can you select it?

Link to comment
Share on other sites

Hmm, I didn't know you can put gameobjects for attach points, I write them down in .cfg myself. I also don't use the node_collider (isn't node_collider obsolete?), but I pick an object and add convex mesh collider (if it is invisible, collider-only object then remove rendering component). Everything else is the same. And I never made engines.

As I said before, I was following what the (as seen REALLY outdated) tutorials said.

Link to comment
Share on other sites

I am unfamiliar with 3DS personally, but in unity, try clearing the "main camera" then adding an empty game object. Drag your asset model into the game object so that it is tabbed over from the "GameObject" and below it. from there, apply the mesh collider to the Model file. Any Thrust transform or other "transform values" must be within that main GameObject, I personally keep the gameobject at top, followed by the model, followed by the light*If applicable* Followed by any Transforms. This is all under the Game Object in the SAME tabbing level as the Model.

I'll show you some screenshots if you need a visual reference.

Link to comment
Share on other sites

Node_collider is for the old system, you can still create a separate collider object and wrap a mesh collider around it if your visual mesh isn't the shape you want the collider to be but I'd avoid naming it that to prevent confusion. You want to remove the mesh filter and mesh renderer components if you do that, don't leave the filter on unless you've got good reason to.

The normal method is either to add box/sphere/capsule colliders to your model (or otherwise blank GameObjects created in unity if you need multiple) or add a mesh collider to the object with your visible mesh on which will wrap itself around the visible mesh automatically if the simpler and better performing colliders won't make the right shape. Be sure to tick the convex box or it won't collide properly.

Anyway, the fact that the game is loading suggests that there's nothing wrong with the model file technically (although do check the output_log.txt file in KSP data and/or the in-game Alt+F2 console for error messages), although it will load objects using multiple materials even though KSP can only render the first one (that's GameObjects, you can use multiple materials per part as long as they're on seperate objects).

In unity do GameObjects>Create Other>Cube and set it's position to 0,0,0. That cube is approximately 2.5m in game and after you've set it's position it's centred on the VAB cursor. If your part is far too small or far too large or significantly offset compared to that then that's likely to be your problem - it's rendering fine but not where you can see it.

The FX being on in the VAB seems to be some sort of default fallback, I've encountered it under several situations. Assuming you're not using a custom plugin I'd check your config - make sure you've got matching brackets on all your modules.

Link to comment
Share on other sites

I am unfamiliar with 3DS personally, but in unity, try clearing the "main camera" then adding an empty game object. Drag your asset model into the game object so that it is tabbed over from the "GameObject" and below it. from there, apply the mesh collider to the Model file. Any Thrust transform or other "transform values" must be within that main GameObject, I personally keep the gameobject at top, followed by the model, followed by the light*If applicable* Followed by any Transforms. This is all under the Game Object in the SAME tabbing level as the Model.

I'll show you some screenshots if you need a visual reference.

oLKbDo.jpg

Would that be correct?

Link to comment
Share on other sites

Node_collider is for the old system, you can still create a separate collider object and wrap a mesh collider around it if your visual mesh isn't the shape you want the collider to be but I'd avoid naming it that to prevent confusion. You want to remove the mesh filter and mesh renderer components if you do that, don't leave the filter on unless you've got good reason to.

Already worked that out.

The normal method is either to add box/sphere/capsule colliders to your model (or otherwise blank GameObjects created in unity if you need multiple) or add a mesh collider to the object with your visible mesh on which will wrap itself around the visible mesh automatically if the simpler and better performing colliders won't make the right shape. Be sure to tick the convex box or it won't collide properly.

Done beforehand

In unity do GameObjects>Create Other>Cube and set it's position to 0,0,0. That cube is approximately 2.5m in game and after you've set it's position it's centred on the VAB cursor. If your part is far too small or far too large or significantly offset compared to that then that's likely to be your problem - it's rendering fine but not where you can see it.

Did this, everything looks perfect.

The FX being on in the VAB seems to be some sort of default fallback, I've encountered it under several situations. Assuming you're not using a custom plugin I'd check your config - make sure you've got matching brackets on all your modules.

No plugins being used, cfg is a copy of the normal nuclearEngine part, except that I changed values to match this smaller version. Anyways, checked it again, there were no visible mistakes.

Link to comment
Share on other sites

Already worked that out.

Done beforehand

Did this, everything looks perfect.

No plugins being used, cfg is a copy of the normal nuclearEngine part, except that I changed values to match this smaller version. Anyways, checked it again, there were no visible mistakes.

Can you paste the config file or host it somewhere for us to peek through?

Link to comment
Share on other sites

Can you paste the config file or host it somewhere for us to peek through?

http://pastebin.com/bhr901bT

I have to fix the node_stacks and write their new positions.

Looks reasonable. I would delete the node_stack objects before you export (or move them out of the hierarchy so they don't get exported), it's generally not a good idea to use terms significant elsewhere.

Done.

Link to comment
Share on other sites

Looking at your unity screenshot again I see you have an object named Part Tools. If you've got the exporter (part tools script) attached to that then that will be the problem. The part tools script exports the object it's attached to and it's children, not the whole scene, so you need to have it on the object named 'GameObject' in that picture.

Link to comment
Share on other sites

Looking at your unity screenshot again I see you have an object named Part Tools. If you've got the exporter (part tools script) attached to that then that will be the problem. The part tools script exports the object it's attached to and it's children, not the whole scene, so you need to have it on the object named 'GameObject' in that picture.

I just noticed that.

I noticed that my model.mu was 1kb in size, and that it had no texture being exported (yes, i'm retarded and airheaded enough to not notice that before).

Link to comment
Share on other sites

If you look at this thread you can find out how to turn on/off the Play Automatically option. This is why your part is working even while in the VAB. Note however that turning this "off" means when you check to see if your parts animation works in Unity by clicking the play button it will not animate until you switch it back to play automatically. I usually leave play automatically on until Im exporting.

http://forum.kerbalspaceprogram.com/showthread.php/27450-Importing-animations-from-Blender-to-Unity/page2

But this should fix the always-on problem you are having. (I think, I honestly cant remember if this works for thrust transform too... damit I just made an engine type thing a few days ago @.@)

Edited by Xellith
Link to comment
Share on other sites

If you look at this thread you can find out how to turn on/off the Play Automatically option. This is why your part is working even while in the VAB. Note however that turning this "off" means when you check to see if your parts animation works in Unity by clicking the play button it will not animate until you switch it back to play automatically. I usually leave play automatically on until Im exporting.

http://forum.kerbalspaceprogram.com/showthread.php/27450-Importing-animations-from-Blender-to-Unity/page2

But this should fix the always-on problem you are having.

it's not an animation that is playing, it's the engine fx. Thanks anyways, i'll keep it for future reference.

By the way now the texture is not being exported by parttools.

Link to comment
Share on other sites

Well the engine FX is just a unity transform animation right? Meaning that if its on in the VAB its because something is clicked to "Play Automatically" or some such.

I want to believe it is not related to that, because when I tested with someone else's .mu, it wasn't there, so I think it's related to a model/texture error.

Link to comment
Share on other sites

Well the engine FX is just a unity transform animation right?

No, I don't think so. It's a ParticleEmitter and a rigidBody.AddForce()

I'm not sure what's causing the problem with the textures (I assume it's texture, it doesn't matter if they're in MBM or PNG format), are any error messages showing up in the unity console? Is the model file appearing in game correctly but untextured (solid grey)?

Link to comment
Share on other sites

No, I don't think so. It's a ParticleEmitter and a rigidBody.AddForce()

I'm not sure what's causing the problem with the textures (I assume it's texture, it doesn't matter if they're in MBM or PNG format), are any error messages showing up in the unity console? Is the model file appearing in game correctly but untextured (solid grey)?

Console:

File error:

at (wrapper managed-to-native) UnityEngine.Object:get_name ()

at PartToolsEditor+PartWriter.WriteMaterial (System.IO.BinaryWriter bw, UnityEngine.Material mat) [0x00000] in C:\Users\Wolf\Documents\KSPPart\Assets\Plugins\Editor\PartToolsEditor.cs:324

at PartToolsEditor+PartWriter.Write (System.String modelName, System.String filePath, System.String filename, System.String fileExtension, UnityEngine.Transform target, Boolean copyTexturesToTargetDir, Boolean convertTextures, Boolean renameTextures, TextureFormat textureFormat) [0x000cc] in C:\Users\Wolf\Documents\KSPPart\Assets\Plugins\Editor\PartToolsEditor.cs:140

UnityEngine.Debug:LogError(Object)

PartWriter:Write(String, String, String, String, Transform, Boolean, Boolean, Boolean, TextureFormat) (at Assets/Plugins/Editor/PartToolsEditor.cs:155)

PartToolsEditor:DrawWriterGUI() (at Assets/Plugins/Editor/PartToolsEditor.cs:85)

PartToolsEditor:OnInspectorGUI() (at Assets/Plugins/Editor/PartToolsEditor.cs:20)

UnityEditor.DockArea:OnGUI()

About the other stuff, the game won't even start, it hangs up when loading the part.

Link to comment
Share on other sites

Yeah, it will do if the model/texture file isn't getting written properly.

Looks like the part tools don't like your material for some reason, that's not a common error.

What format is your texture in? I know PNG works but maybe unity is accepting Targa, TIFF, PSD etc. while the part tools won't. I guess your texture is in RGB/24-bit and not RGBA/32-bit? Unity is likely to enforce that though.

Link to comment
Share on other sites

Yeah, it will do if the model/texture file isn't getting written properly.

Looks like the part tools don't like your material for some reason, that's not a common error.

What format is your texture in? I know PNG works but maybe unity is accepting Targa, TIFF, PSD etc. while the part tools won't. I guess your texture is in RGB/24-bit and not RGBA/32-bit? Unity is likely to enforce that though.

1024 x 1024 24-bit JPG.

Link to comment
Share on other sites

I've just checked the code. It claims to be choking on the name of the material but that's the first line in the writing of a material so it may be the material is invalid in some other sense. Materials are written near the end of the file though, so it is likely to be something connected with materials - and they are written before textures.

If the material was created automatically on import it might be worth creating a new material in unity then dragging that onto the model, the UVMapping should be preserved.

Link to comment
Share on other sites

I've just checked the code. It claims to be choking on the name of the material but that's the first line in the writing of a material so it may be the material is invalid in some other sense. Materials are written near the end of the file though, so it is likely to be something connected with materials - and they are written before textures.

If the material was created automatically on import it might be worth creating a new material in unity then dragging that onto the model, the UVMapping should be preserved.

Created a new material an dragged it to the mesh, this was the result:

File error:

at (wrapper managed-to-native) UnityEngine.Object:get_name ()

at PartToolsEditor+PartWriter.WriteMaterial (System.IO.BinaryWriter bw, UnityEngine.Material mat) [0x00000] in C:\Users\Wolf\Documents\KSPPart\Assets\Plugins\Editor\PartToolsEditor.cs:324

at PartToolsEditor+PartWriter.Write (System.String modelName, System.String filePath, System.String filename, System.String fileExtension, UnityEngine.Transform target, Boolean copyTexturesToTargetDir, Boolean convertTextures, Boolean renameTextures, TextureFormat textureFormat) [0x000cc] in C:\Users\Wolf\Documents\KSPPart\Assets\Plugins\Editor\PartToolsEditor.cs:140

UnityEngine.Debug:LogError(Object)

PartWriter:Write(String, String, String, String, Transform, Boolean, Boolean, Boolean, TextureFormat) (at Assets/Plugins/Editor/PartToolsEditor.cs:155)

PartToolsEditor:DrawWriterGUI() (at Assets/Plugins/Editor/PartToolsEditor.cs:85)

PartToolsEditor:OnInspectorGUI() (at Assets/Plugins/Editor/PartToolsEditor.cs:20)

UnityEditor.DockArea:OnGUI()

Link to comment
Share on other sites

Well, I used the search funcion, I read all the tutorials, I downloaded all the needed tools, I already had the skill from before, I was a calm and reflexive individual before this, but now I'm blind, not because of accidentally looking at the sun, but because I'm enlightened by my own rage.

I'll proceed to explain in chronological order:

•I made my asset in 3Ds Max 2010.

•I made sure to center it as every freaking tutorial said

•Textured it by unwrapping

•Exported it to FBX with Z-up as the (recently closed) 3ds max tutorial said

•Opened a new project in Unity

•Imported the model following the UNITY AND KSP tutorial (setting scale factor, creating colliders and lighting UVs)

•Watched the scale factors and all that jazz (my part is 1m diameter at 1 unit = 1 meter on 3ds max)

•Added my node_collider box created in 3dmax as a mesh collider to my main mesh, clicking convex of course.

•Created empty gameobjects to position my node_stack_top and bottom and thrustTransform

•Exported the model to .mu format with the texture converted to mbm (also tried png)

•Grabbed the .mu and sent it to my parts folder at ksp folder

•Created the CFG taking others as a base, but putting my own coordinates for the nodes and watching carefully any other possible mistake, there were none to be seen.

AND ALL I GET IS AN INVISIBLE USELESS PART AND AN ENGINE FX THAT IS ON EVEN IN THE VAB. I seriously want to shoot myself down there so that it doesn't kill me but it hurts enough to forget this painful experience.

Any help appreciated, if you need any additional data just ask.

I had the same problems, and I had been using 3dsmax for 10 years, it wasn't a user error it was simply an over-fluffled sequence of events and tutorials containing old information, old screenshots of max and the plugin export screen..

I tore some hair out, then thought.. why not try blender, it's free and it's cant be any worse than 3dsmax.

I had my part exported and textured within about 30 minutes from the first time I ever opened blender, and havent looked back since, in fact havent even started 3dsmax in about 3 months, which sorta does suck because it cost a small fortune.

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