Hot answers tagged

7

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


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


5

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


5

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


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


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

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

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

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

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


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

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


3

Press button N while hovering your mouse over the graph editor or click (or drag) this little left-direction arrow here:


3

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


3

Envelope modifier EDIT: On re-readig the question this is more in regard to strength than scale. Can add an envelope modifier after the noise modifier. Set control points to expand or contract accordingly. Example gif, add a control point limiting noise to [-1, 1] and then at frame 140 expand to [-10, 10] For scale one method would be to add modifiers ...


2

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


2

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


2

The online manual states that "In Blender 2.5, IPO Curves have been replaced by FCurves, however, editing these curves is essentially still the same." https://www.blender.org/manual/animation/editors/graph/fcurves.html I'll dig more for "deltas" info. [edit] see this thread an BA it may help you: http://blenderartists.org/forum/showthread.php?219126-Move-...


2

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)


2

Anyway, I have just created the solution (solution or workaround, others may judge). If you have encountered this page by looking for a solution, congratulations. I created a script that solves this situation by copying the second and next-to-last keyframes before and after the first and last keyframes, forcing the curve to interpolate and removing those ...


2

You can move them into a Channel group to get them out of the way, but you can not hide the overview of the channels. The user can do this by marking the channels with SHIFT and pressing CTRL+G And with coding: group = bpy.data.actions['CubeAction'].groups.new("hidden") bpy.data.actions['CubeAction'].fcurves[0].group=group


2

import bpy import math thecube = bpy.context.scene.objects['Cube'] def updateFramePlease(): #get the values from these properties on this frame oxVal = bpy.context.scene.objects['Cube']['o_x'] oyVal = bpy.context.scene.objects['Cube']['o_y'] ozVal = bpy.context.scene.objects['Cube']['o_z'] #get the current frame number cframe = bpy....


2

For Sound Drivers Addon I do a lot of sound baking, so I thought I'd check out how it would perform running in background mode (this has led to another q re running modal timer operators in bg mode). Anyhow using context override the following bakes in bg mode using command blender -b ./Desktop/baketest.blend --python-text bake.py using the following as a ...


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