Jump to content

Wanted: Unity .anim text with KSP particle emitter


Recommended Posts

Ok, I'm having an issue with KSP trying to load a part with a particle emitter. Since I'm using Unity 5 the error in the KSP logs looks suspiciously like the error when I first tried to animate emissives. Basically, I'm trying to turn the particle emitter off by changing the value of the 'emit' setting. Dunno if I'm doing it wrong, but if I'm doing it right I'd appreciate a text output of an .anim file that toggles the emit from a 4.2.2 copy of Unity. Basically, I think the classID in the anim was changed by Unity but isn't recognized by KSP. Here's the .anim file I'm having issues with just as an example of what I'd like to compare.

Thanks


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: valveAnim
serializedVersion: 6
m_Legacy: 1
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 31
- time: .166666672
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 31
m_PreInfinity: 2
m_PostInfinity: 2
attribute: emit
path: Steam_Whistle_Cylinder1_auv/GameObject
classID: 114
script: {fileID: -1272454729, guid: 1d6ea3ac39c17304f87ac73826842850, type: 3}
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_StartTime: 0
m_StopTime: .166666672
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 31
- time: .166666672
value: 1
inSlope: Infinity
outSlope: Infinity
tangentMode: 31
m_PreInfinity: 2
m_PostInfinity: 2
attribute: emit
path: Steam_Whistle_Cylinder1_auv/GameObject
classID: 114
script: {fileID: -1272454729, guid: 1d6ea3ac39c17304f87ac73826842850, type: 3}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_GenerateMotionCurves: 0
m_Events: []

Link to comment
Share on other sites

I think you got it mixed up. KSP Particles are exported as separate MU files, it's essentially an empty game object with a particle emitter. They are spawned and attached at run time in KSP and values manipulated through part modules in the part config file, usually engines, or RCS with RCSFX plugin.

you never animate any values of an emitter in a animation clip. Doing so will most likely cause an error when you attempt to export the part.

Link to comment
Share on other sites

Well, that's not what I read. Ok, so I can get the emitter working in unity no problem. How do I turn it on and off? The plan is, to use it instead of the animations used in heat dissipators. Does naming it in the config instead of an animation turn it on and off?

Here's what I read. Granted, it's pretty sparse but it seems to say you can change the emitter properties with an animation. Unity had no problem with it and toggling the emitter in the animation did work. KSP didn't like it when it tried to import it.

Edited by Fengist
Link to comment
Share on other sites

I'm guessing it's the classID that's changed. That's one of the things that changed on emissives and was throwing the same error in the logs. Which is why I'd kinda like to see an .anim from 4.2.2 that toggles the emissive and see what classID it is.

Edited by Fengist
Link to comment
Share on other sites

I loved working with curves in Unity 5, cause version 4 lacks even basic features like copying and pasting curve nodes.

But the problem is Unity 5 uses different emissive curve IDs, KSP PartTools doesn't recognize them.

Here's my emissive animation gears.anim it has moving parts and emissive, you'll distinguish them. Don't know how you extracted the code from the .anim file.

Link to comment
Share on other sites

Thanks Enceos but I won't be able to read it. In order to make animations a YAML (text) file you'll need to change a setting in unity. In this link is the how to change unity to tell it to export the animations as text. It's also the method I use to make Unity 5 emissives work in KSP. Also Xyphos has created a script to convert Unity 5 emissives to KSP here.

What I really need is a text animation file that changes something, anything in the KSP Particle Emitter. It appears that anything that gets animated with the particle emitter, Unity gives it a classID of 114. I suspect that changed between Unity 4.2.2 and 5 to the point that KSP doesn't recognize it.

Edited by Fengist
Link to comment
Share on other sites

here's one, I added curves on the Emit and Max Energy attributes, from 4.2.2

%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: particleCurve
serializedVersion: 3
m_AnimationType: 1
m_Compressed: 0
m_RotationCurves: []
m_CompressedRotationCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 6
outSlope: 6
tangentMode: 10
- time: .166666672
value: 1
inSlope: 6
outSlope: 6
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: emit
path:
classID: 114
script: {fileID: -1272454729, guid: a1b1dd47b2bfcd04ba9203ca055053c4, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 3
inSlope: 21
outSlope: 21
tangentMode: 10
- time: .333333343
value: 10
inSlope: 21
outSlope: 21
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: maxEnergy
path:
classID: 114
script: {fileID: -1272454729, guid: a1b1dd47b2bfcd04ba9203ca055053c4, type: 3}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_MuscleClipInfo:
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 6
outSlope: 6
tangentMode: 10
- time: .166666672
value: 1
inSlope: 6
outSlope: 6
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: emit
path:
classID: 114
script: {fileID: -1272454729, guid: a1b1dd47b2bfcd04ba9203ca055053c4, type: 3}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 3
inSlope: 21
outSlope: 21
tangentMode: 10
- time: .333333343
value: 10
inSlope: 21
outSlope: 21
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: maxEnergy
path:
classID: 114
script: {fileID: -1272454729, guid: a1b1dd47b2bfcd04ba9203ca055053c4, type: 3}
m_EulerEditorCurves: []
m_Events: []

Link to comment
Share on other sites

  • 2 weeks later...
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...