[Bf-committers] RNA_def_struct_sdna_from using a non-DNA struct
Rohan Smith
rohan.preacher.smith at gmail.com
Mon Aug 10 02:17:11 CEST 2015
Hi,
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_define_verify_sdna(0);
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);
RNA_define_verify_sdna(1);
}
Is there any way to make the RNA system able to use a non-DNA struct in
this manner?
--
Cheers,
Rohan Smith
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
More information about the Bf-committers
mailing list