Fix T65146: Curve Texture Coordinates in Cycles and Eevee differ

Remove the use UV for mapping option.
This commit is contained in:
Clément Foucault
2020-01-29 21:36:58 +01:00
parent 33317b4647
commit 6576148722
6 changed files with 10 additions and 39 deletions

View File

@@ -197,7 +197,6 @@ url_manual_mapping = (
("bpy.types.compositornodedilateerode*", "compositing/types/filter/dilate_erode.html#bpy-types-compositornodedilateerode"),
("bpy.types.compositornodeellipsemask*", "compositing/types/matte/ellipse_mask.html#bpy-types-compositornodeellipsemask"),
("bpy.types.compositornodesplitviewer*", "compositing/types/output/split_viewer.html#bpy-types-compositornodesplitviewer"),
("bpy.types.curve.use_uv_as_generated*", "editors/uv/generated_uvs.html#bpy-types-curve-use-uv-as-generated"),
("bpy.types.dynamicpaintbrushsettings*", "physics/dynamic_paint/brush.html#bpy-types-dynamicpaintbrushsettings"),
("bpy.types.materialgpencilstyle.flip*", "grease_pencil/materials/grease_pencil_shader.html#bpy-types-materialgpencilstyle-flip"),
("bpy.types.materialgpencilstyle.mode*", "grease_pencil/materials/grease_pencil_shader.html#bpy-types-materialgpencilstyle-mode"),

View File

@@ -144,7 +144,6 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
curve = context.curve
col = layout.column()
col.prop(curve, "use_uv_as_generated")
col.prop(curve, "use_auto_texspace")
col = layout.column()

View File

@@ -177,7 +177,6 @@ int BKE_mesh_nurbs_displist_to_mdata(struct Object *ob,
void BKE_mesh_from_nurbs_displist(struct Main *bmain,
struct Object *ob,
struct ListBase *dispbase,
const bool use_orco_uv,
const char *obdata_name,
bool temporary);
void BKE_mesh_from_nurbs(struct Main *bmain, struct Object *ob);

View File

@@ -522,7 +522,6 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
Mesh *BKE_mesh_new_nomain_from_curve_displist(Object *ob, ListBase *dispbase)
{
Curve *cu = ob->data;
Mesh *mesh;
MVert *allvert;
MEdge *alledge;
@@ -530,7 +529,6 @@ Mesh *BKE_mesh_new_nomain_from_curve_displist(Object *ob, ListBase *dispbase)
MPoly *allpoly;
MLoopUV *alluv = NULL;
int totvert, totedge, totloop, totpoly;
bool use_orco_uv = (cu->flag & CU_UV_ORCO) != 0;
if (BKE_mesh_nurbs_displist_to_mdata(ob,
dispbase,
@@ -540,7 +538,7 @@ Mesh *BKE_mesh_new_nomain_from_curve_displist(Object *ob, ListBase *dispbase)
&totedge,
&allloop,
&allpoly,
(use_orco_uv) ? &alluv : NULL,
&alluv,
&totloop,
&totpoly) != 0) {
/* Error initializing mdata. This often happens when curve is empty */
@@ -580,12 +578,8 @@ Mesh *BKE_mesh_new_nomain_from_curve(Object *ob)
}
/* this may fail replacing ob->data, be sure to check ob->type */
void BKE_mesh_from_nurbs_displist(Main *bmain,
Object *ob,
ListBase *dispbase,
const bool use_orco_uv,
const char *obdata_name,
bool temporary)
void BKE_mesh_from_nurbs_displist(
Main *bmain, Object *ob, ListBase *dispbase, const char *obdata_name, bool temporary)
{
Object *ob1;
Mesh *me_eval = ob->runtime.mesh_eval;
@@ -609,7 +603,7 @@ void BKE_mesh_from_nurbs_displist(Main *bmain,
&totedge,
&allloop,
&allpoly,
(use_orco_uv) ? &alluv : NULL,
&alluv,
&totloop,
&totpoly) != 0) {
/* Error initializing */
@@ -706,14 +700,13 @@ void BKE_mesh_from_nurbs_displist(Main *bmain,
void BKE_mesh_from_nurbs(Main *bmain, Object *ob)
{
Curve *cu = (Curve *)ob->data;
bool use_orco_uv = (cu->flag & CU_UV_ORCO) != 0;
ListBase disp = {NULL, NULL};
if (ob->runtime.curve_cache) {
disp = ob->runtime.curve_cache->disp;
}
BKE_mesh_from_nurbs_displist(bmain, ob, &disp, use_orco_uv, cu->id.name, false);
BKE_mesh_from_nurbs_displist(bmain, ob, &disp, cu->id.name, false);
}
typedef struct EdgeLink {
@@ -1023,8 +1016,6 @@ static void curve_to_mesh_eval_ensure(Object *object)
static Mesh *mesh_new_from_curve_type_object(Object *object)
{
Curve *curve = object->data;
const bool uv_from_orco = (curve->flag & CU_UV_ORCO) != 0;
Object *temp_object = object_for_curve_to_mesh_create(object);
Curve *temp_curve = (Curve *)temp_object->data;
@@ -1039,12 +1030,8 @@ static Mesh *mesh_new_from_curve_type_object(Object *object)
temp_curve->editnurb = NULL;
/* Convert to mesh. */
BKE_mesh_from_nurbs_displist(NULL,
temp_object,
&temp_object->runtime.curve_cache->disp,
uv_from_orco,
curve->id.name + 2,
true);
BKE_mesh_from_nurbs_displist(
NULL, temp_object, &temp_object->runtime.curve_cache->disp, curve->id.name + 2, true);
/* BKE_mesh_from_nurbs changes the type to a mesh, check it worked. If it didn't the curve did
* not have any segments or otherwise would have generated an empty mesh. */

View File

@@ -330,7 +330,7 @@ enum {
CU_BACK = 1 << 2,
CU_PATH = 1 << 3,
CU_FOLLOW = 1 << 4,
CU_UV_ORCO = 1 << 5,
/* CU_UV_ORCO = 1 << 5, */ /* DEPRECATED */
CU_DEFORM_BOUNDS_OFF = 1 << 6,
CU_STRETCH = 1 << 7,
/* CU_OFFS_PATHDIST = 1 << 8, */ /* DEPRECATED */

View File

@@ -1033,16 +1033,9 @@ static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna)
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
}
static void rna_def_nurbs(BlenderRNA *UNUSED(brna), StructRNA *srna)
static void rna_def_nurbs(BlenderRNA *UNUSED(brna), StructRNA *UNUSED(srna))
{
PropertyRNA *prop;
/* flags */
prop = RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
RNA_def_property_ui_text(
prop, "Use UV for Mapping", "Uses the UV values as Generated textured coordinates");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* Nothing. */
}
static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
@@ -1757,12 +1750,6 @@ static void rna_def_curve(BlenderRNA *brna)
prop, "rna_Curve_texspace_size_get", "rna_Curve_texspace_size_set", NULL);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
RNA_def_property_ui_text(
prop, "Use UV for mapping", "Uses the UV values as Generated textured coordinates");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* materials */
prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");