[Bf-committers] RNA_def_struct_sdna_from using a non-DNA struct
rohan.preacher.smith at gmail.com
Tue Aug 11 14:00:08 CEST 2015
That's pretty much the entire reason I'm wanting to get these structs
working nicely with the RNA system, as there's quite a lot of variables
which define the muscle's dynamics.
I had it set to BoneData and MuscleData in the BoneData and MuscleData
RNA definitions which worked just fine for some reason.
The RNA code is at , the DNA is at  and the editmode structs are
With the RNA_def_struct_sdna_from uncommented on lines 1388 and 1413, I
get "RNA_def_struct_sdna_from: EditArmatureElement not found." errors at
Thanks for your help with this.
On 10/08/2015 23:26, Lukas Tönne wrote:
> I think this is not an issue with non-DNA structs in RNA: you can make RNA
> struct types that have no relation to DNA whatsoever (although it's a lot
> more cumbersome because every property has to use getter/setter callbacks).
> What this code seems to do is
> 1) define the 'EditMuscleData' RNA type
> 2) define a property 'data' of EditMuscleData - which is supposedly also of
> EditMuscleData type! (2nd argument to RNA_def_struct_sdna_from)
> This would require a nested RNA struct type, which is not possible afaik. I
> guess the 'data' property is of a different type anyway. If you need more
> help please paste the full DNA/RNA code to www.pasteall.org and post a link
> here (to avoid excessively long mails).
> On Mon, Aug 10, 2015 at 2:17 AM, Rohan Smith <rohan.preacher.smith at gmail.com
>> I'm working on a physically based animation system using Blender and
>> Blender's real time engine. To this end, I've modified my version of
>> Blender to split Bones and EditBones up into three sections,
>> ArmatureElements which store spatial information and a pointer to
>> specific data structs, BoneData which stores bone specific data such as
>> mass and physics properties, and MuscleData which stores muscle specific
>> properties. These are all in the DNA system, but the Edit version of
>> these structs are not.
>> When trying to setup the RNA code to work nicely with this setup, the
>> non-Edit structs work fine, but I get a "RNA_def_struct_sdna_from:
>> EditMuscleData not found." error in makesrna when I try to use
>> RNA_def_struct_sdna_from with the Edit versions. Without this the code
>> in the generated .c file does not do the proper dereferencing.
>> static void rna_def_edit_muscle(BlenderRNA *brna)
>> StructRNA *srna;
>> srna = RNA_def_struct(brna, "EditMuscleData", "EditArmatureElement");
>> RNA_def_struct_sdna(srna, "EditMuscleData");
>> RNA_def_struct_ui_text(srna, "Edit Muscle Data", "Edit mode Muscle
>> specific data of an Armature Element");
>> RNA_def_struct_sdna_from(srna, "EditMuscleData", "data");
>> rna_def_muscle_common(srna, 1);
>> Is there any way to make the RNA system able to use a non-DNA struct in
>> this manner?
>> Rohan Smith
>> This email has been checked for viruses by Avast antivirus software.
>> Bf-committers mailing list
>> Bf-committers at blender.org
> Bf-committers mailing list
> Bf-committers at blender.org
This email has been checked for viruses by Avast antivirus software.
More information about the Bf-committers