diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-24 16:14:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-24 16:38:15 +0300 |
commit | 7a9ad029dd1d1afe42d54c9c181de887636db7c0 (patch) | |
tree | e9281cbe8bb01365a699ffd6f4bbd09a6a91015f /source/blender/makesrna/intern | |
parent | 707340edd703ff1fd7c8157eb3cc811913698c8d (diff) |
Remove TexFace, per-face images
TexFace complicates the now more popular shading pipeline by having
per-face images, see: T51382 for details.
To keep the ability to select a per-material edit-image
(used with UV-mapping workflow), the material now stores an image
which will be set when changing images in edit-mode.
This is used as a bake-target when not using Cycles too.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 18 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 50 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 5 |
4 files changed, 6 insertions, 72 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index b293f20dd95..8779d2b65e7 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1887,6 +1887,12 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group"); RNA_def_property_update(prop, 0, "rna_Material_update"); + prop = RNA_def_property(srna, "edit_image", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "edit_image"); + RNA_def_property_struct_type(prop, "Image"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Edit Image", "Image to use for UV-mapping"); + prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "index"); RNA_def_property_ui_text(prop, "Pass Index", "Index number for the \"Material Index\" render pass"); @@ -1964,18 +1970,6 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Shadow Type", "How to draw shadows"); RNA_def_property_update(prop, 0, "rna_Material_update"); - prop = RNA_def_property(srna, "use_face_texture", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE); - RNA_def_property_ui_text(prop, "Face Textures", - "Replace the object's base color with color from UV map image textures"); - RNA_def_property_update(prop, 0, "rna_Material_update"); - - prop = RNA_def_property(srna, "use_face_texture_alpha", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA); - RNA_def_property_ui_text(prop, "Face Textures Alpha", - "Replace the object's base alpha value with alpha from UV map image textures"); - RNA_def_property_update(prop, 0, "rna_Material_update"); - prop = RNA_def_property(srna, "use_cast_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode2", MA_CASTSHADOW); RNA_def_property_ui_text(prop, "Cast Shadows", diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 33d6de97f97..88a5944a09d 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1203,42 +1203,6 @@ static int rna_MeshPaintMaskLayer_data_length(PointerRNA *ptr) /* End paint mask */ -static void rna_TexturePoly_image_set(PointerRNA *ptr, PointerRNA value) -{ - MTexPoly *tf = (MTexPoly *)ptr->data; - ID *id = value.data; - - if (id) { - /* special exception here, individual faces don't count - * as reference, but we do ensure the refcount is not zero */ - if (id->us == 0) - id_us_plus(id); - else - id_lib_extern(id); - } - - tf->tpage = (struct Image *)id; -} - -/* while this is supposed to be readonly, - * keep it to support importers that only make tessfaces */ -static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value) -{ - MTFace *tf = (MTFace *)ptr->data; - ID *id = value.data; - - if (id) { - /* special exception here, individual faces don't count - * as reference, but we do ensure the refcount is not zero */ - if (id->us == 0) - id_us_plus(id); - else - id_lib_extern(id); - } - - tf->tpage = (struct Image *)id; -} - static int rna_MeshTessFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { MFace *face = (MFace *)ptr->data; @@ -2342,13 +2306,6 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_MeshTextureFace_path"); RNA_def_struct_ui_icon(srna, ICON_FACESEL_HLT); - prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tpage"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - /* these are for editing only, access at loops now */ #if 0 prop = RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE); @@ -2454,13 +2411,6 @@ static void rna_def_mtexpoly(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_MeshTexturePoly_path"); RNA_def_struct_ui_icon(srna, ICON_FACESEL_HLT); - prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tpage"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_TexturePoly_image_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - #if 0 /* moved to MeshUVLoopLayer */ prop = RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 1a8dd05a7b5..6273902e833 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2248,11 +2248,6 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Vertical Scale", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "use_image_override", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE); - RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - srna = RNA_def_struct(brna, "UVProjector", NULL); RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier"); diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 1714188db2f..efa828ab8c7 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -280,7 +280,6 @@ static void rna_Scene_collada_export( int include_shapekeys, int deform_bones_only, int active_uv_only, - int include_uv_textures, int include_material_textures, int use_texture_copies, int triangulate, @@ -306,7 +305,6 @@ static void rna_Scene_collada_export( deform_bones_only, active_uv_only, - include_uv_textures, include_material_textures, use_texture_copies, @@ -406,9 +404,6 @@ void RNA_api_scene(StructRNA *srna) RNA_def_boolean(func, "active_uv_only", false, "Only Selected UV Map", "Export only the selected UV Map"); - RNA_def_boolean(func, "include_uv_textures", false, - "Include UV Textures", "Export textures assigned to the object UV Maps"); - RNA_def_boolean(func, "include_material_textures", false, "Include Material Textures", "Export textures assigned to the object Materials"); |