Hot answers tagged

8

Adding a modifier to an FCurve is much like adding a modifier to an Object, you first add it, then you adjust the properties. Adding the Modifier + Setting properties Here is shown how to add a modifier to an existing fcurve for an object, but it's very similar when the subject is a keyframed property of a shader tree. import bpy obj = bpy.data.objects['...


8

After some digging through the Blender source code, I found the answer. Short answer: They're just Bézier curves. Long answer: They're normal Bézier curves with certain restrictions placed on the positions of the handles (the red circles). If the first handle is to the left of the second handle, as in the following image, then the curve is evaluated as a ...


7

It's right under your nose ;-) They are a member of the "Bezier Spline" family called an "F-curve," shortened from "Ferguson's Parametric Cubic Curves." The F-curve is actually a direct derivative of the Catmull-Rom Spline (names you should recognize from other CGI algorithms). As stated in the introductory research an f-curve: "attempts to fix the ...


7

It's useful for more complex situations than this. Let's say you have an object with a subsurf modifier, and you pass a reference to that modifier to some function: mod = bpy.context.object.modifiers['Subsurf'] somefunc(mod) That function can now figure out the path of a property of the subdivision surface, like this: def somefunc(mod): print(mod....


5

You don't need a script, this is built into the f-curve modifier copy/paste feature. Just copy the modifier using the button next to it, then select all the curves you want to paste it to and hit the paste button. Then make sure "Only Active" is unchecked. Posted some screenshots here: How to copy F-Curve Modifier(s) from one object to multiple objects in ...


5

Locate and select an edge-loop in your jacket-mesh which follows the path of your zip. ShiftD duplicate it, and P separate it to a new object. Convert it to a curve. I found I could set the spline-type to Bezier and decimate it to 0.1 without losing visible detail. Place the origin of your curve at its bottom control-point, and move the zip-array to the ...


4

Subdividing Bezier curves is normally done using De Casteljau's algorithm. However, fcurves aren't pure Bezier curves. It is not hard to make a bezier curve "run backwards" along the time axis. Since this would create ambiguities in the animation system, blender prevents that by using modified handle coordinates whenever the handles could make the curve ...


4

To select and move 2 curve handles at the same time you can use simple way which means selecting everything first, and then deselecting what shouldn't be moved. Select all the curve points which should be edited, set the curve handles type to Free with V > Free. With MMB deselect curve points and those curve handles which should stay untouched. Move only ...


4

The action editor that you are using only shows a subset of keyframed values, to see all available keyed data you need to use the full dopesheet or the graph editor. If the values you are looking for are still not visible then check the options in the header that filter the displayed items. EDIT: An action is basically a container for animation data that ...


4

An fcurve is made up of splines connecting key frame points. FCurve.keyframe_points a set of points (x, y) analogous to (frame, value). import bpy context = bpy.context # use action on active object obj = context.object action = obj.animation_data.action # location fcurves fcurves = [fc for fc in action.fcurves if fc.data_path == "location"] # set ...


4

With a script These things are most easily done with a script. The script below, looks for all pose bone fcurves, all posebone scale fcurves and all posebone quaternion fcurves and assigns them to variables pbfcurves, scalefcurves and rotfcurves respectively. Note if you are using Euler rotation change to rotation_quaternion to rotation_euler If you know ...


4

Using API methods takes away the need for context Inserting a keyframe on a node, adds an fcurve to the scene nodetree action. From the datapath, find the fcurve and add a new modifier of type 'NOISE' and set the appropriate settings. For example def execute(self, context): sc = context.scene tree = sc.node_tree gamma_node = tree.nodes.new(...


4

Using FCurve.evaluate(frame) and numpy In this related answer have found the minimum of an fcurve based on 0.01 subframe increments, instead here will find the first point where the fcurve is greater than a given value. Test script, loops over all actions and prints the frame (and value) where it first exceeds value. import bpy import numpy as np value = 10 ...


4

It looks like the base modifier is set to f(t) = sin(t) . That is to say, f(0) = 0, f(pi/2) = 1, f(pi) = 0 and f(3*pi/2) = -1 So the frequency is 2 * pi (The curve repeats itself every 6,283185307... units). If you want to tweak the frequency, say you want a cycle every 10 frames, multiply the phase by 2 * pi and divide by 10.


3

The error AttributeError: 'NoneType' object has no attribute 'action' is saying that animation_data (which is the object you are trying to access the action property from) is resolving to None - meaning it does not exist, which is because you haven't animated any properties of the object. In your situation, you are animating a material property which stores ...


3

Have you considered the NLA? Add Noise to your original fcurve. Cycle with strip repeat Add Noise to the NLA strip Add Noise to the animated influence Add noise to the animated strip time. Produces some random patterns over the cycles, with a fair touch of overkill. Just the repeat and noise modifier in the NLA would suffice.


3

I found that this moves an FCurve from one bone to another: def moveFcurve(action, fromBone, toBone): for fc in [fc for fc in action.fcurves if fc.group.name == fromBone]: fc.group.name = toBone for channel in fc.group.channels: channel.data_path = channel.data_path.replace(fromBone, toBone)


3

I was trying to use keyframe_insert(), but what I needed to use was keyframe_points.add(). Here is a sample that adds a F-Curve with an ease-in and ease-out to the driver: import bpy context = bpy.context data = bpy.data aobj = context.active_object me = aobj.data scn = context.scene objs = data.objects if me.shape_keys == None: bpy.ops.object....


3

Sound Drivers Been doing a lot of sound baking lately too. You'll find different audio files have different levels, so unless you normalize them first using ffmpeg or similar you will have to find a way to deal with them. What I have done in sound drivers is added a minmax property to each fcurve and using those values added an envelope modifier. (Had to ...


3

Add an envelope modifier to the baked fcurve to remap to your desired range. Another way, and one I use extensively in my sound drivers addon, is to bake the sound to a custom property prop, then set up a driver , SCRIPTED EXPRESSION type, with the baked property as a variable (SINGLE_PROPERTY type) var datapath '["prop"]' and make the expression 60 * var. ...


3

Graph Editor is what You need to use in this situation. You can edit frames values one by one, all together or even add a modifier, that will create a move, that you want.


3

The coordinate and handles (co, handle_left, handle_right) can be read / set from the KeyFrame keyframe point. Test code, runs on action on active object. Prints the fcurve name and each co and handle. import bpy context = bpy.context obj = context.object action = context.object.animation_data.action #print("fcurve_dic = {") for fcurve in action.fcurves: ...


3

As you know the scenes animation fcurves are found in fc = bpy.context.scene.animation_data.action.fcurves The fcurves list has a remove method - fc.remove(fc[0]) Which leads to changing your code to for scene in bpy.data.scenes: fcurves = scene.animation_data.action.fcurves for c in fcurves: if c.data_path.startswith("...


3

Simply click the Constraint to F-Curve option on the constraint. This will remove the constraint and produce the required keyframes to replace it. You can then view and edit the animation in the Graph Editor.


3

Good ol' fashion hook modifier. One way to set up a hook. Snap 3d cursor to control point of curve in edit mode, then in object mode add an empty. With the empty selected, shift select the curve return to edit mode, and "Hook to selected Object" (from space search). Now you can animate the position of the hook to manipulate your curve. Adding more ...


3

As per @cegaton's request, I'll show officially how I fixed this. STEP 1: Select a vertex of your curve that you wish to be able to animate in edit mode (it has been beveled to give it a 3D look) . Press Ctrl + H and a simple empty should appear. STEP 2: Go out of edit mode and select the empty. The hook modifier will be automatically placed on your ...


3

Both the fcurves themselves, and the action groups are part of the action object. You have to create new groups through the action and then assign that group to any fcurves you want inside it. armature = bpy.context.scene.objects.active anim_data = armature.animation_data action = anim_data.action # create a new group group_1 = action.groups.new("group_1") ...


3

In this answer I shall demonstrate what the Attack and Release values represents. Though, I will update the answer with more concepts and practical implementation as soon as I get the time. Attack And Release In music production, there is a concept called ADSR or Attack Decay Sustain Release. When we define an ADSR envelope of some sound, we are basically ...


3

It looks like you can do this with the "Cycles" curve modifier instead of the Generator modifier. I did the exact same thing as you to get the elastic curve, but only added two keyframes, one on frame 0, and one on frame 30 (I tried this at 30fps). For the elastic settings, I used an amplitude of 0.1 and a period of 15 frames (1/2 framerate). To ...


Only top voted, non community-wiki answers of a minimum length are eligible