Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#25894] Problems with properties across files

Date:
2011-02-01 10:58
Priority:
3
State:
Closed
Submitted by:
Thomas Larsson (thomasl)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Animation system
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Problems with properties across files
Detailed description
I have been following a rigging tutorial in Maya by Jason Schleifer. He is using properties to drive things like FK/IK switch, and I have tried to do the same thing in Blender. This is conceptually cleaner than using bones as drivers - a property is a property and not a bone. However, I have run into some rather severe problems with properties and file linking. At least some of them are bugs.

Run the script. It creates an armature where the middle bone has copy-location constraints targeting Left and Right. The constraint influence is driven by the enum property Side = {Left,Right}, and initially set to Right. Moreover, the armature is assigned to a group for file linking.

The first picture shows the situation just after the script has been run. This is what I want. The problems arise when I use the armature in other files.


MISFEATURE 1. Properties are lost after linking as groups and proxifying.

The situation before and after proxification is shown in figure 2. The problem is that groups are not objects and can not have properties. This is more or less a show-stopper, because file linking as groups is a must for me.

The cleanest solution would be to make groups into objects in their own right. This would allow for hierarchical grouping, which may be cool. However, I realize that this may require a massive redesign, which is probably not worth it. But to allow groups to have properties is perhaps not too difficult.


BUG 2. Properties are lost after linking as objects and proxifying.

The situation before and after proxification is shown in figure 3. The linked object has the property, but nothing can be done with it. The proxy has no property. I think this is a bug.


BUG 3. Properties are lost after Blender restart.

Run the script, save file, quit Blender, restart Blender, open file. The situation is shown in figure 4. There are two bugs:
3a. The property definition is lost. The enum has been replaced by an integer.
3b. The property no longer drives the constraint. Although Side = 1 the driver variable x = 0. Pressing Update Dependencies does not help.


NUISANCE 4. Properties can not be set to symbolic enums in python.

In the script the property is set by
ob['Side'] = 1
I don't want to remember that the numeric value of Right = 1, but want to write instead
ob['Side'] = 'Right'



Followup

Message
  • Date: 2011-02-01 14:06
  • Sender: Ton Roosendaal
  • I'm responsible for the library linking and proxy feature, but I don't work on python or custom properties for it...

    What I do know is that a "proxy" was coded to allow posing on a local armature, saving out the animation locally as well, but *not* saving any local data of the proxy.
    That means that all proxy properties are synced with the stored library armature all the time.

    However, the local proxy could still allow to set own custom properties for driver usage (which is part of local action).
    Campbell knows a bit more of this though :)
  • Date: 2011-02-01 22:56
  • Sender: Campbell Barton
  • Hi, Ill look into this but some Q's regarding your report.

    First I should mention that proxies and properties are mainly intended to work on pose bone level.
    Properties can be added to objects, meshes, armatures, Bones (as well as pose bones) & groups, but this workflow with proxies is not well defined.

    For pose bones protected layers keep linked data reference from the library and unprotected layers are edited locally, though new properties added to the linked data are merged into local data & made local to make updating rigs easier.

    1) Groups do have properties: console example.
    >>> grp = bpy.data.groups.new("MyGroup")
    >>> grp["MyProp"] = 22

    Its just there is no way to access them from the UI at the moment because we have no concept of an active group.
    active objects dupligroup or a way to make one of the groups an object is in into the active group are possible but not all that nice.
    I'm not sure this would do what you want since the group is linked and not editable.

    Nevertheless, we should add Group property access from the UI.

    2) Fixed r34611. But note that there if no linking, once the proxy is made the data is local and not updated from the original file, this is by design and I'm not sure if its useful to you.

    3) There are 2 kinds of property access:
    a) Direct IDProperty access pose.bones["SomeBone"]["SomeProperty"], stored per datablock (Bone, Object, Group etc).
    b) RNA Access pose.bones["SomeBone"].SomeProperty, (Stored per type, so all matching types have this property once defined, internally uses IDProperties internally)

    For RNA access the rna definition needs to run before access. Notice the "Register" option in the text editor, this was added so scripts associated with a blend file could run on startup and the properties would not vanish.
    One problem we didn't resolve yet is scripts for rigs have no way to automatically import from the library, this still needs to be done manually.

    4) This is related to (3), internally the ENUM is stored as a number, without an RNA definition it is expesed as a number.
    In the script attached there is:
    ob['Side'] = 1
    ...This can be
    ob.Side = 'Right'
    ...Since RNA is defined.

    ---

    Did you read this?, it may help in understanding blender/python/properties
    http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro


    Closing this report, since issue #2 is fixed and other issues are not bugs.
    If you find a bug can you report, give blend file + exact steps to redo the problem and we'll investigate.
 

Attached Files:

Name Date Download
4-props-after-blender-restart-and-load.jpg 2011-02-01 10:58 Download
3-linked-object.jpg 2011-02-01 10:58 Download
2-linked-group.jpg 2011-02-01 10:58 Download
1-props-just-created.jpg 2011-02-01 10:58 Download
prop-drivers.py 2011-02-01 10:58 Download

Changes:

Field Old Value Date By
status_idOpen2011-02-01 22:56campbellbarton
close_dateNone2011-02-01 22:56campbellbarton
StatusInvestigate2011-02-01 22:56campbellbarton
assigned_tonone2011-02-01 14:06ton
CategoryNone2011-02-01 14:06ton
StatusNew2011-02-01 14:06ton
File Added14826: prop-drivers.py2011-02-01 10:58thomasl
File Added14827: 1-props-just-created.jpg2011-02-01 10:58thomasl
File Added14828: 2-linked-group.jpg2011-02-01 10:58thomasl
File Added14829: 3-linked-object.jpg2011-02-01 10:58thomasl
File Added14830: 4-props-after-blender-restart-and-load.jpg2011-02-01 10:58thomasl