Jump to content

Need help with animations


Recommended Posts

I'm trying to make a very, very basic proof-of-concept launch clamp just so I can understand the process and make sure I know how this works.  I seem to have most of it behaving, except for the animation.   I've never gotten an animation to work on anything.

I'm using Blender 2.71 because it's what I'm used to.  I've tried 2.83 and it's rather confusing since they seem to have moved everything and all my muscle memory is now useless.

I'm using Unity 2019.4.0f1.  I realize it's not the what I'm supposed to be using for 1.8 +, but 2019.2.2f1 isn't available for Linux.

If either of these versions could be the problem, let me know.  Yesterday I got emissives working in 1.9.1 with Unity 2017.1.0 so I wasn't sure how critical exact versioning was.

 

This is what I started with for the clamp:

And this for the animation.

https://www.youtube.com/watch?v=n0VspDUOErE&t=397s

 

You may notice that these are rather outdated, since I can't really find any sort of current tutorials.

 

So the clamp is placeable and it functions as a clamp.  Release works fine, but the animation doesn't run.

In Blender:

Spoiler

Blender.png

Animation in Blender:

Spoiler

Blender.gif

 

In Unity:

Spoiler

Unity.png

I can run the animation in Unity, in the bottom right as shown, but I can only get it to run in the Scene if the animation component is added higher up in the hierarchy.  If I put the animation component on anything other than the object highlighted in the gif, it won't run in scene when I go to Window -> animation

Spoiler

Unity.gifUnityMain.gif

 

I have tried multiple combinations of which object to put the Animation component on, as well as many different variations in the config file for trf_animationRoot_name and anim_decouple_name.  Nothing seems to work.  However, if I have the "Play Automatically" box checked in the Animation component box, the animation will run immediately when placing the clamps in the VAB.

Spoiler

KSPAuto.gif

So I know the animation's getting into the .mu file.  I'm hoping it's just a matter of me not being able to figure out how to call it.

Here's the config.  I just hacked up the stock launch clamp config file.

Spoiler

PART
{
    name = bwiclamptest
    module = Part
    author = Geonovast
    mesh = clamptest.mu
    rescaleFactor = 1
    node_attach = 0.0, 3.29759, -1.83256, 0.0, 0.0, 1.0
    fx_gasBurst_white = 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, activate
    sound_decoupler_fire = activate
    TechRequired = generalConstruction
    entryCost = 1800
    cost = 200
    category = Structural
    subcategory = 0
    title = T
    manufacturer = T
    description = T
    attachRules = 0,1,0,1,0
    mass = 0.1
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.2
    angularDrag = 2
    crashTolerance = 100
    maxTemp = 2000 // = 5000
    fuelCrossFeed = False
    explosionPotential = 0.1
    breakingForce = 150
    breakingTorque = 150
    stageOffset = 0
    childStageOffset = 0
    bulkheadProfiles = srf
    tags = #autoLOC_500890 //#autoLOC_500890 = clam hold )pad rocket stabil tower
    MODULE
    {
        name = LaunchClamp
        trf_towerPivot_name = Cap
        trf_towerStretch_name = Tower
        trf_anchor_name = Base
        trf_animationRoot_name = ClampArm
        anim_decouple_name = ClampArmAction
    }
    MODULE
    {
        name = ModuleGenerator
        isAlwaysActive = true
        isGroundFixture = true
        OUTPUT_RESOURCE
        {
            name = ElectricCharge
            rate = 1
        }
    }
    MODULE
    {
        name = ModuleTestSubject
        useStaging = True
        useEvent = False
        situationMask = 4
        useProgressForBodies = False
        usePrestigeForSit = False
        CONSTRAINT
        {
            type = SITUATION
            value = 4
            body = _Home
        }
        CONSTRAINT
        {
            type = SITUATION
            value = 0
            body = _NotHome
        }
        CONSTRAINT
        {
            type = REPEATABILITY
            value = ONCEPERPART
        }
    }
}



Any help would be appreciated.  Let me know if I need to provide any more info.

Link to comment
Share on other sites

One thing I don't see in your post - did you set the Animation type to Legacy?

I'm using a different Unity version so things are a bit different but if I click on the blue box icon in the Hierarchy (that's where my Animation is) the inspector shows a "Model" label with two buttons after - an Open and a Select. Pressing the select changes the inspector to a view with four buttons across the top (Model, Rig, Animation, Materials) - I press the Rig button and the first line is "Animation Type" with a drop down that has Legacy as one of the options.

Link to comment
Share on other sites

When I make a part with an animation the an Animator (the one that is changed to an Animation as it looks like you did) is attached to the what I think would be your testclamp (the blue box one). The one thing that looks different and I would not have thought it would make a difference is that in Blender I usually have an Empty as the parent object for the entire part.

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