Missing RNA Path Defines for 'rigid_body.kinematic' #40913

Closed
opened 2014-07-01 22:38:03 +02:00 by Warwick Molloy · 11 comments

System Information
Windows 8.1, nVidia GeForce GTX 770

Blender Version
2.71 (official) Dated: 2014-06-25 Hash: 9337574

Short description of error
Can't apply Keying Set that was defined by RMB Add Keying Set on the property 'Animated' in a Rigid Body setting.
The Keying Set referred to this as "rigid_body.kinematic"

Exact steps for others to reproduce the error
I followed the steps for Method 1 listed here: http://aligorith.blogspot.com.au/2010/12/animating-in-25-getting-to-grips-with.html
I am trying to insert a key frame for the 'animated' option on a number of objects all in a group. Having defined the keying set using method 1, I tried to apply it but get the message "Keying Set failed to insert any keyframes" and, as per the blog, I'm raising this bug report because the RNA Path may not yet have been defined in Blender.

                - Exported Python Script for Keying Set-----------------

Keying Set: ButtonKeyingSet

import bpy

scene = bpy.context.scene

Keying Set Level declarations

ks = scene.keying_sets.new(idname="ButtonKeyingSet", name="AnimatedCollision Keying Set")
ks.bl_description = "Marks objects as animated in the rigid body settings"

ks.bl_options = {'INSERTKEY_VISUAL'}

ID's that are commonly used

id_0 = bpy.data.groups["03-CollissionRingRocks"]

Path Definitions

ksp = ks.paths.add(id_0, 'rigid_body.kinematic', index=0)

**System Information** Windows 8.1, nVidia GeForce GTX 770 **Blender Version** 2.71 (official) Dated: 2014-06-25 Hash: 9337574 **Short description of error** Can't apply Keying Set that was defined by RMB Add Keying Set on the property 'Animated' in a Rigid Body setting. The Keying Set referred to this as "rigid_body.kinematic" **Exact steps for others to reproduce the error** I followed the steps for Method 1 listed here: http://aligorith.blogspot.com.au/2010/12/animating-in-25-getting-to-grips-with.html I am trying to insert a key frame for the 'animated' option on a number of objects all in a group. Having defined the keying set using method 1, I tried to apply it but get the message "Keying Set failed to insert any keyframes" and, as per the blog, I'm raising this bug report because the RNA Path may not yet have been defined in Blender. - Exported Python Script for Keying Set----------------- # Keying Set: ButtonKeyingSet import bpy scene = bpy.context.scene # Keying Set Level declarations ks = scene.keying_sets.new(idname="ButtonKeyingSet", name="AnimatedCollision Keying Set") ks.bl_description = "Marks objects as animated in the rigid body settings" ks.bl_options = {'INSERTKEY_VISUAL'} # ID's that are commonly used id_0 = bpy.data.groups["03-CollissionRingRocks"] # Path Definitions ksp = ks.paths.add(id_0, 'rigid_body.kinematic', index=0)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @WazzaM

Added subscriber: @WazzaM
Member

Added subscriber: @JoshuaLeung

Added subscriber: @JoshuaLeung
Member

Have you manually edited the keying set? Specifically, the ID block used (as shown above) appears to be a group, and not an object as it should be.

Have you manually edited the keying set? Specifically, the ID block used (as shown above) appears to be a group, and not an object as it should be.
Member

EDIT: Ah... I overlooked the description...

Currently, groups cannot be used to host animation data themselves, so it's not possible to have all this animation in a single action attached to the group (with paths relative to that).

If you simply want a keying set which goes through and keyframes this setting for all objects within that group (but the keyframes don't need to belong to the same action), you can implement a keying set using python as follows:

import bpy
import keyingsets_utils
from bpy.types import KeyingSetInfo

class AnimatedCollisionKeyingSet(KeyingSetInfo):
    bl_idname = "AnimatedCollision"
    bl_name = "Animated Collision"
    
    def poll(ksi, context):
        return True             # XXX: you may want to restrict this to only happen when an object from that group is selected. In that case, replace this function with the line below
 #poll = keyingsets_utils.RKS_POLL_selected_items     # (or similar)
    def iterator(ksi, context, ks):
        group = bpy.data.groups["03-CollissionRingRocks"]
        for ob in group.objects:
            ksi.generate(context, ks, ob)
    def generate(ksi, context, ks, data):
        ks.paths.add(data, 'rigid_body.kinematic', index=0)
EDIT: Ah... I overlooked the description... Currently, groups cannot be used to host animation data themselves, so it's not possible to have all this animation in a single action attached to the group (with paths relative to that). If you simply want a keying set which goes through and keyframes this setting for all objects within that group (but the keyframes don't need to belong to the same action), you can implement a keying set using python as follows: ``` import bpy import keyingsets_utils from bpy.types import KeyingSetInfo class AnimatedCollisionKeyingSet(KeyingSetInfo): bl_idname = "AnimatedCollision" bl_name = "Animated Collision" def poll(ksi, context): return True # XXX: you may want to restrict this to only happen when an object from that group is selected. In that case, replace this function with the line below ``` #poll = keyingsets_utils.RKS_POLL_selected_items # (or similar) ``` def iterator(ksi, context, ks): group = bpy.data.groups["03-CollissionRingRocks"] for ob in group.objects: ksi.generate(context, ks, ob) ``` ``` def generate(ksi, context, ks, data): ks.paths.add(data, 'rigid_body.kinematic', index=0)
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Joshua Leung self-assigned this 2014-07-02 03:23:17 +02:00
Member

For now, I won't consider this a bug report.

However, I have noted down some todo's from this relating to groups, which will unfortunately take some time to resolve.

For now, I won't consider this a bug report. However, I have noted down some todo's from this relating to groups, which will unfortunately take some time to resolve.
Author

Hi Aligorith

You've been awesome with this so I thought I'd let you know how I went.

I tried the code fragment you gave but nothing happens because the class isn't instantiated and never gets executed when I run it through the Scripting . I've looked at keyingsets_builtins.py and I appreciate this is similar to the builtin keyingsets and should plug in somehow but I'm not sure what to do next.

I have found I can create the keyframes via scripting (no keying sets though) using this code below but I'm trying to create two keyframes and the second overwrites the first. I'll probably figure this out but it's not real clear how the index plays a part in keyframes.

This might not be your area but as some feedback on the API, it's very powerful that I get the object back when I call fcurve.new() and it would be equally cool if I got a tuple or list back when I called .keyframe_points.add(n) so I could set the frame number and value. Of course the add() function could take the frame number and value as a parameter too, to make it really friendly. I'm trying to use a -1 index on the array of keyframe_points to get the last object and update it but the overwrite is still happening so I'm making some mistake. I'll try more with it...

import bpy

scene = bpy.context.scene
objects = bpy.data.objects

  • Keying Set Level declarations
  • ks = scene.keying_sets.new(idname="KinematicsKeyingSet", name="AnimatedCollision Keying Set")

ks.bl_description = "Marks objects as animated in the rigid body settings"


ks.bl_options = {'INSERTKEY_VISUAL'}


def AddKinematicKeyFrame(obj, frameNo, val):
	if obj.animation_data == None:
		obj.animation_data_create()
	actName = obj.name + "_pyAction"
	obj.animation_data.action = bpy.data.actions.new(name=actName)
	fc = obj.animation_data.action.fcurves
	idx = len( fc.values() )
	fcKin = fc.new(data_path="rigid_body.kinematic", index = idx)
# fcKin = fc.values()[0]
	fcKin.keyframe_points.add(1)
# get last keyframepoint
	kfp = fcKin.keyframe_points[-1]
	kfp.co = frameNo, val

Path Definitions

for i in range(1,401):
	objId = "03-Saturn-ring-Rock.%03d"%i
	obj = objects[objId]
	AddKinematicKeyFrame(obj, 0.0, 1.0)
	AddKinematicKeyFrame(obj, 79.0, 0.0)

Hi Aligorith You've been awesome with this so I thought I'd let you know how I went. I tried the code fragment you gave but nothing happens because the class isn't instantiated and never gets executed when I run it through the Scripting . I've looked at keyingsets_builtins.py and I appreciate this is similar to the builtin keyingsets and should plug in somehow but I'm not sure what to do next. I have found I can create the keyframes via scripting (no keying sets though) using this code below but I'm trying to create two keyframes and the second overwrites the first. I'll probably figure this out but it's not real clear how the index plays a part in keyframes. This might not be your area but as some feedback on the API, it's very powerful that I get the object back when I call fcurve.new() and it would be equally cool if I got a tuple or list back when I called .keyframe_points.add(n) so I could set the frame number and value. Of course the add() function could take the frame number and value as a parameter too, to make it really friendly. I'm trying to use a -1 index on the array of keyframe_points to get the last object and update it but the overwrite is still happening so I'm making some mistake. I'll try more with it... ``` import bpy scene = bpy.context.scene objects = bpy.data.objects ``` - Keying Set Level declarations - ks = scene.keying_sets.new(idname="KinematicsKeyingSet", name="AnimatedCollision Keying Set") # ks.bl_description = "Marks objects as animated in the rigid body settings" ``` ``` # ks.bl_options = {'INSERTKEY_VISUAL'} ``` def AddKinematicKeyFrame(obj, frameNo, val): if obj.animation_data == None: obj.animation_data_create() actName = obj.name + "_pyAction" obj.animation_data.action = bpy.data.actions.new(name=actName) fc = obj.animation_data.action.fcurves idx = len( fc.values() ) fcKin = fc.new(data_path="rigid_body.kinematic", index = idx) ``` # fcKin = fc.values()[0] ``` fcKin.keyframe_points.add(1) ``` # get last keyframepoint ``` kfp = fcKin.keyframe_points[-1] kfp.co = frameNo, val ``` # Path Definitions ``` for i in range(1,401): objId = "03-Saturn-ring-Rock.%03d"%i obj = objects[objId] AddKinematicKeyFrame(obj, 0.0, 1.0) AddKinematicKeyFrame(obj, 79.0, 0.0) ```
Author

I realised I needed to register the class you provided but get this:

>>> register()
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "<blender_console>", line 2, in register
RuntimeError: register_class(...):, missing bl_rna attribute from 'RNAMeta' instance (may not be registered)
I realised I needed to register the class you provided but get this: ``` >>> register() Traceback (most recent call last): File "<blender_console>", line 1, in <module> File "<blender_console>", line 2, in register RuntimeError: register_class(...):, missing bl_rna attribute from 'RNAMeta' instance (may not be registered) ```

Added subscriber: @AvenidaGez

Added subscriber: @AvenidaGez

I am not an expert, but working with an animation, in action editor, Usually at frame zero I do record all bones, location, rotation, scale
I do not know when it happened, but x time after working, bone head keyframe zero was not there, just one I did registered at frame 20.
So in the test, I had a jump, that is how I realized this time the bone head frame zero keyframe was missing
So I did added it again.
Tested, ok. Then of course at the end of the action, frame 320, there was a jump again because needed the copy of frame zero keyframe to cycle ok.
I added that keyframe, tested, all ok, no jumps.
Little time later, I needed to add a new bone head keyframe at frame 40, there appears the problem similar to described here
"keying set faile to insert any keyframe"
saved, reloaded, etc. the same message
So I did the same on other bones, insert a keyframe in between, this is, bones which have some keyframes betwwen start and end (320)
all, ok,
But trying in bone head failed with same message
so, a needed to insert a keyframe at frame 40, so I deleted all bones from there to the end (frame 320)
It worked, the bone head keyframe was inserted
continued working.
The message appeared again when I tried to insert a bone head in between
If I remove the frames from where I need to insert the keyframe to the end, then there is no error.

I am not an expert, but working with an animation, in action editor, Usually at frame zero I do record all bones, location, rotation, scale I do not know when it happened, but x time after working, bone head keyframe zero was not there, just one I did registered at frame 20. So in the test, I had a jump, that is how I realized this time the bone head frame zero keyframe was missing So I did added it again. Tested, ok. Then of course at the end of the action, frame 320, there was a jump again because needed the copy of frame zero keyframe to cycle ok. I added that keyframe, tested, all ok, no jumps. Little time later, I needed to add a new bone head keyframe at frame 40, there appears the problem similar to described here "keying set faile to insert any keyframe" saved, reloaded, etc. the same message So I did the same on other bones, insert a keyframe in between, this is, bones which have some keyframes betwwen start and end (320) all, ok, But trying in bone head failed with same message so, a needed to insert a keyframe at frame 40, so I deleted all bones from there to the end (frame 320) It worked, the bone head keyframe was inserted continued working. The message appeared again when I tried to insert a bone head in between If I remove the frames from where I need to insert the keyframe to the end, then there is no error.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#40913
No description provided.