py api function to tag all ID blocks, was available in 2.4x as.

bpy.data.meshes.tag = True

But this was only useful for setting so make it a function for 2.5x.
 bpy.data.objects.tag(False)


X3D: use tagging rather then a name dictionary, this fixes a bug where library name overlaps could mix up names.
This commit is contained in:
Campbell Barton 2011-01-05 05:33:27 +00:00
parent d387c19444
commit 370adc51ff
4 changed files with 232 additions and 54 deletions

@ -82,9 +82,6 @@ class x3d_class:
self.it = 3
#--- class private don't touch ---
self.texNames = {} # dictionary of textureNames
self.matNames = {} # dictionary of materiaNames
self.meshNames = {} # dictionary of meshNames
self.indentLevel = 0 # keeps track of current indenting
self.filepath = filepath
self.file = None
@ -438,17 +435,13 @@ class x3d_class:
#-- IndexedFaceSet or IndexedLineSet
# user selected BOUNDS=1, SOLID=3, SHARED=4, or TEXTURE=5
ifStyle = "IndexedFaceSet"
# look up mesh name, use it if available
if meshME in self.meshNames:
self.writeIndented("<%s USE=\"ME_%s\">" % (ifStyle, meshME), 1)
self.meshNames[meshME] += 1
if mesh.tag:
self.writeIndented("<IndexedFaceSet USE=\"ME_%s\">" % meshME, 1)
else:
if int(mesh.users) > 1:
self.writeIndented("<%s DEF=\"ME_%s\" " % (ifStyle, meshME), 1)
self.meshNames[meshME] = 1
else:
self.writeIndented("<%s " % ifStyle, 1)
mesh.tag = True
self.writeIndented("<IndexedFaceSet DEF=\"ME_%s\" " % meshME, 1)
if bTwoSided == 1:
self.file.write("solid=\"false\" ")
@ -488,7 +481,7 @@ class x3d_class:
self.writingtexture = 0
self.writingcolor = 0
#--- output closing braces
self.writeIndented("</%s>\n" % ifStyle, -1)
self.writeIndented("</IndexedFaceSet>\n", -1)
self.writeIndented("</Shape>\n", -1)
self.writeIndented("</Transform>\n", -1)
@ -575,51 +568,49 @@ class x3d_class:
def writeMaterial(self, mat, matName, world):
# look up material name, use it if available
if matName in self.matNames:
if mat.tag:
self.writeIndented("<Material USE=\"MA_%s\" />\n" % matName)
self.matNames[matName] += 1
return
self.matNames[matName] = 1
emit = mat.emit
ambient = mat.ambient / 3.0
diffuseColor = tuple(mat.diffuse_color)
if world:
ambiColor = tuple(((c * mat.ambient) * 2.0) for c in world.ambient_color)
else:
ambiColor = 0.0, 0.0, 0.0
mat.tag = True
emitColor = tuple(((c * emit) + ambiColor[i]) / 2.0 for i, c in enumerate(diffuseColor))
shininess = mat.specular_hardness / 512.0
specColor = tuple((c + 0.001) / (1.25 / (mat.specular_intensity + 0.001)) for c in mat.specular_color)
transp = 1.0 - mat.alpha
emit = mat.emit
ambient = mat.ambient / 3.0
diffuseColor = tuple(mat.diffuse_color)
if world:
ambiColor = tuple(((c * mat.ambient) * 2.0) for c in world.ambient_color)
else:
ambiColor = 0.0, 0.0, 0.0
if mat.use_shadeless:
ambient = 1.0
shininess = 0.0
specColor = emitColor = diffuseColor
emitColor = tuple(((c * emit) + ambiColor[i]) / 2.0 for i, c in enumerate(diffuseColor))
shininess = mat.specular_hardness / 512.0
specColor = tuple((c + 0.001) / (1.25 / (mat.specular_intensity + 0.001)) for c in mat.specular_color)
transp = 1.0 - mat.alpha
self.writeIndented("<Material DEF=\"MA_%s\" " % matName, 1)
self.file.write("diffuseColor=\"%s %s %s\" " % round_color(diffuseColor, self.cp))
self.file.write("specularColor=\"%s %s %s\" " % round_color(specColor, self.cp))
self.file.write("emissiveColor=\"%s %s %s\" \n" % round_color(emitColor, self.cp))
self.writeIndented("ambientIntensity=\"%s\" " % (round(ambient, self.cp)))
self.file.write("shininess=\"%s\" " % (round(shininess, self.cp)))
self.file.write("transparency=\"%s\" />" % (round(transp, self.cp)))
self.writeIndented("\n", -1)
if mat.use_shadeless:
ambient = 1.0
shininess = 0.0
specColor = emitColor = diffuseColor
self.writeIndented("<Material DEF=\"MA_%s\" " % matName, 1)
self.file.write("diffuseColor=\"%s %s %s\" " % round_color(diffuseColor, self.cp))
self.file.write("specularColor=\"%s %s %s\" " % round_color(specColor, self.cp))
self.file.write("emissiveColor=\"%s %s %s\" \n" % round_color(emitColor, self.cp))
self.writeIndented("ambientIntensity=\"%s\" " % (round(ambient, self.cp)))
self.file.write("shininess=\"%s\" " % (round(shininess, self.cp)))
self.file.write("transparency=\"%s\" />" % (round(transp, self.cp)))
self.writeIndented("\n", -1)
def writeImageTexture(self, image):
name = image.name
filepath = os.path.basename(image.filepath)
if name in self.texNames:
if image.tag:
self.writeIndented("<ImageTexture USE=\"%s\" />\n" % self.cleanStr(name))
self.texNames[name] += 1
else:
image.tag = True
self.writeIndented("<ImageTexture DEF=\"%s\" " % self.cleanStr(name), 1)
self.file.write("url=\"%s\" />" % filepath)
self.writeIndented("\n", -1)
self.texNames[name] = 1
def writeBackground(self, world, alltextures):
if world:
@ -707,6 +698,11 @@ class x3d_class:
EXPORT_TRI=False,
):
# tag un-exported IDs
bpy.data.meshes.tag(False)
bpy.data.materials.tag(False)
bpy.data.images.tag(False)
print("Info: starting X3D export to %r..." % self.filepath)
self.writeHeader()
# self.writeScript()
@ -786,8 +782,6 @@ class x3d_class:
def cleanup(self):
self.file.close()
self.texNames = {}
self.matNames = {}
self.indentLevel = 0
print("Info: finished X3D export to %r" % self.filepath)

@ -65,7 +65,10 @@ int set_listbasepointers(struct Main *main, struct ListBase **lb);
void free_libblock(struct ListBase *lb, void *idv);
void free_libblock_us(struct ListBase *lb, void *idv);
void free_main(struct Main *mainvar);
void tag_main(struct Main *mainvar, int tag);
void tag_main_idcode(struct Main *mainvar, const short type, const short tag);
void tag_main_lb(struct ListBase *lb, const short tag);
void tag_main(struct Main *mainvar, const short tag);
void rename_id(struct ID *id, const char *name);
void name_uiprefix_id(char *name, struct ID *id);

@ -1257,18 +1257,36 @@ static void lib_indirect_test_id(ID *id, Library *lib)
}
}
void tag_main(struct Main *mainvar, int tag)
void tag_main_lb(ListBase *lb, const short tag)
{
ID *id;
if(tag) {
for(id= lb->first; id; id= id->next) {
id->flag |= LIB_DOIT;
}
}
else {
for(id= lb->first; id; id= id->next) {
id->flag &= ~LIB_DOIT;
}
}
}
void tag_main_idcode(struct Main *mainvar, const short type, const short tag)
{
ListBase *lb= which_libbase(mainvar, type);
tag_main_lb(lb, tag);
}
void tag_main(struct Main *mainvar, const short tag)
{
ListBase *lbarray[MAX_LIBARRAY];
ID *id;
int a;
a= set_listbasepointers(mainvar, lbarray);
while(a--) {
for(id= lbarray[a]->first; id; id= id->next) {
if(tag) id->flag |= LIB_DOIT;
else id->flag &= ~LIB_DOIT;
}
tag_main_lb(lbarray[a], tag);
}
}

@ -473,6 +473,35 @@ void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSetting
/* XXX python now has invalid pointer? */
}
/* tag functions, all the same */
void rna_Main_cameras_tag(Main *bmain, int value) { tag_main_lb(&bmain->camera, value); }
void rna_Main_scenes_tag(Main *bmain, int value) { tag_main_lb(&bmain->scene, value); }
void rna_Main_objects_tag(Main *bmain, int value) { tag_main_lb(&bmain->object, value); }
void rna_Main_materials_tag(Main *bmain, int value) { tag_main_lb(&bmain->mat, value); }
void rna_Main_node_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->nodetree, value); }
void rna_Main_meshes_tag(Main *bmain, int value) { tag_main_lb(&bmain->mesh, value); }
void rna_Main_lamps_tag(Main *bmain, int value) { tag_main_lb(&bmain->lamp, value); }
void rna_Main_libraries_tag(Main *bmain, int value) { tag_main_lb(&bmain->library, value); }
void rna_Main_screens_tag(Main *bmain, int value) { tag_main_lb(&bmain->screen, value); }
void rna_Main_window_managers_tag(Main *bmain, int value) { tag_main_lb(&bmain->wm, value); }
void rna_Main_images_tag(Main *bmain, int value) { tag_main_lb(&bmain->image, value); }
void rna_Main_lattices_tag(Main *bmain, int value) { tag_main_lb(&bmain->latt, value); }
void rna_Main_curves_tag(Main *bmain, int value) { tag_main_lb(&bmain->curve, value); }
void rna_Main_metaballs_tag(Main *bmain, int value) { tag_main_lb(&bmain->mball, value); }
void rna_Main_fonts_tag(Main *bmain, int value) { tag_main_lb(&bmain->vfont, value); }
void rna_Main_textures_tag(Main *bmain, int value) { tag_main_lb(&bmain->tex, value); }
void rna_Main_brushes_tag(Main *bmain, int value) { tag_main_lb(&bmain->brush, value); }
void rna_Main_worlds_tag(Main *bmain, int value) { tag_main_lb(&bmain->world, value); }
void rna_Main_groups_tag(Main *bmain, int value) { tag_main_lb(&bmain->group, value); }
void rna_Main_shape_keys_tag(Main *bmain, int value) { tag_main_lb(&bmain->key, value); }
void rna_Main_scripts_tag(Main *bmain, int value) { tag_main_lb(&bmain->script, value); }
void rna_Main_texts_tag(Main *bmain, int value) { tag_main_lb(&bmain->text, value); }
void rna_Main_sounds_tag(Main *bmain, int value) { tag_main_lb(&bmain->sound, value); }
void rna_Main_armatures_tag(Main *bmain, int value) { tag_main_lb(&bmain->armature, value); }
void rna_Main_actions_tag(Main *bmain, int value) { tag_main_lb(&bmain->action, value); }
void rna_Main_particles_tag(Main *bmain, int value) { tag_main_lb(&bmain->particle, value); }
void rna_Main_gpencil_tag(Main *bmain, int value) { tag_main_lb(&bmain->gpencil, value); }
#else
void RNA_api_main(StructRNA *srna)
@ -517,6 +546,10 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a camera from the current blendfile.");
parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
@ -571,6 +604,10 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_REPORTS);
parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_objects_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
@ -596,6 +633,10 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a material from the current blendfile.");
parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_materials_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -628,6 +669,10 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile.");
parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -652,6 +697,10 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile.");
parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -676,18 +725,55 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile.");
parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_lamps_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainLibraries");
srna= RNA_def_struct(brna, "MainLibraries", NULL);
RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
func= RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainScreens");
srna= RNA_def_struct(brna, "MainScreens", NULL);
RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
func= RNA_def_function(srna, "tag", "rna_Main_screens_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainWindowManagers");
srna= RNA_def_struct(brna, "MainWindowManagers", NULL);
RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
func= RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -725,6 +811,10 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove an image from the current blendfile.");
parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_images_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
@ -750,6 +840,10 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile.");
parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -776,6 +870,10 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a curve from the current blendfile.");
parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_curves_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -800,6 +898,10 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile.");
parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -825,6 +927,10 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a font from the current blendfile.");
parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -851,6 +957,10 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a texture from the current blendfile.");
parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_textures_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -875,6 +985,10 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a brush from the current blendfile.");
parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
@ -900,6 +1014,10 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a world from the current blendfile.");
parm= RNA_def_pointer(func, "world", "World", "", "World to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
@ -925,6 +1043,10 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a group from the current blendfile.");
parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_groups_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -959,11 +1081,29 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
/* return type */
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "tag", "rna_Main_texts_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainSounds");
srna= RNA_def_struct(brna, "MainSounds", NULL);
RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
/* TODO, 'load' */
func= RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
@ -987,6 +1127,10 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile.");
parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -1011,6 +1155,10 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a action from the current blendfile.");
parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_actions_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
{
@ -1035,10 +1183,25 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile.");
parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_particles_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainGreasePencils");
srna= RNA_def_struct(brna, "MainGreasePencils", NULL);
RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
func= RNA_def_function(srna, "tag", "rna_Main_gpencil_tag");
parm= RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
#endif