Jump to content

Trouble Spawning Certain Props In Unity


Recommended Posts

Howdy!

I'm trying to do some IVA work and I'm having problems spawning in some of the props.  Specifically Seat_Pilot, Seat_Passenger, the crew hatches, basically everything in the Squad/Props/PropGeneric folder with the exception of Button_DockingMode, which I tried just for completeness.  I can spawn every other prop in the GameData folder without issue.

The error it gives is something like "Cannot clone model because Squad/Props/PropGeneric/Seat_Pilot does not have a model" or something to that effect, but it obviously has a model.  The model is named correctly in the folder, and if I import the .mu file into Blender it's named correctly there, too.  The prop comes into the scene pink.  It has the correct shape and I can move it around, but when I export the config file those pink items are not present.  If I manually add them back to the config file they load properly in the game.

I've looked at the Seat_Pilot.cfg file and the path is correct.  I mean, it's a Squad part so I would expect it to be correct, but I verified it anyway.  I've tried it with a clean install of KSP.  I've tried it with my modded install of KSP.  I've tried it directly within the steamapps/common/Kerbal Space Program directory.  I've tried everything I can think of to no avail.

I'm currently running Unity 2017.1.3p1 with the latest version of Part Tools.

I really hate having to ask this question.  I've searched the forums and Googled this thing to death and no one else seems to be having this problem, or if they are they aren't posting about it anywhere.  That makes me think it's something specific on my end.  I know it's probably going to be something really simple and really stupid that I'm missing, but I've tried everything I can think of for the past three days and I just can't seem to make it work.

Any insights or suggestions would be greatly appreciated.

Ganex

UPDATE:

These are the five errors in the console when I try spawning the props:

Spoiler

File error:

  at (wrapper managed-to-native) UnityEngine.Material:Internal_CreateWithShader (UnityEngine.Material,UnityEngine.Shader)
  at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00009] in C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:260 
  at KSPPartTools.PartReader.ReadMaterial4 (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0 
  at KSPPartTools.PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at KSPPartTools.PartReader.Read (.UrlFile file) [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
KSPPartTools.PartReader:Read(UrlFile)
KSPPartTools.GameDatabase:GetModel(String)
KSPPartTools.PartUtils:CompileModel(UrlConfig, ConfigNode, Single)
KSPPartTools.PartUtils:SpawnProp(Transform, UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProp(UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProps()
KSPPartTools.PartToolsWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Spoiler

Cannot clone model 'Squad/Props/PropsGeneric/Seat_Pilot' as model does not exist
UnityEngine.Debug:LogError(Object)
KSPPartTools.PartUtils:CompileModel(UrlConfig, ConfigNode, Single)
KSPPartTools.PartUtils:SpawnProp(Transform, UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProp(UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProps()
KSPPartTools.PartToolsWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Spoiler

Model was not compiled correctly
UnityEngine.Debug:LogError(Object)
KSPPartTools.PartUtils:CompileModel(UrlConfig, ConfigNode, Single)
KSPPartTools.PartUtils:SpawnProp(Transform, UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProp(UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProps()
KSPPartTools.PartToolsWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Spoiler

Cannot create prop
UnityEngine.Debug:LogError(Object)
KSPPartTools.PartUtils:SpawnProp(Transform, UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProp(UrlConfig, ConfigNode)
KSPPartTools.PartToolsWindow:DrawProps()
KSPPartTools.PartToolsWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Spoiler

NullReferenceException: Object reference not set to an instance of an object
KSPPartTools.PartToolsWindow.DrawProp (.UrlConfig urlCfg, .ConfigNode cfg)
KSPPartTools.PartToolsWindow.DrawProps ()
KSPPartTools.PartToolsWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:272)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:265)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:232)

 

Edited by Ganex
Information Update
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...