[Bf-blender-cvs] [71d4bbf8da6] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object

Antonio Vazquez noreply at git.blender.org
Fri Jun 1 13:23:36 CEST 2018


Commit: 71d4bbf8da68025ebc46a4d0b48b5cbc678e2ff1
Author: Antonio Vazquez
Date:   Fri Jun 1 13:19:35 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB71d4bbf8da68025ebc46a4d0b48b5cbc678e2ff1

Merge branch 'blender2.8' into greasepencil-object

Conflicts:
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/makesrna/intern/rna_material.c

===================================================================



===================================================================

diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 78f389f2707,5867e278c78..f43154b143e
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -499,11 -498,13 +499,9 @@@ void DepsgraphNodeBuilder::build_object
  	if (object->particlesystem.first != NULL) {
  		build_particles(object);
  	}
- 
- 	/* Object that this is a proxy for. */
- 	if (object->proxy) {
- 		object->proxy->proxy_from = object;
- 		build_object(-1, object->proxy, DEG_ID_LINKED_INDIRECTLY);
 -	/* Grease pencil. */
 -	if (object->gpd != NULL) {
 -		build_gpencil(object->gpd);
 -	}
+ 	/* Proxy object to copy from. */
+ 	if (object->proxy_from) {
+ 		build_object(-1, object->proxy_from, DEG_ID_LINKED_INDIRECTLY);
  	}
  	/* Object dupligroup. */
  	if (object->dup_group != NULL) {
diff --cc source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 9ad1cc0a24f,d5ea8103742..de29e54919d
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@@ -542,22 -542,22 +542,18 @@@ void DepsgraphRelationBuilder::build_ob
  	if (object->particlesystem.first != NULL) {
  		build_particles(object);
  	}
- 
- 	/* Object that this is a proxy for. */
- 	if (object->proxy != NULL) {
- 		object->proxy->proxy_from = object;
- 		build_object(NULL, object->proxy);
- 		/* TODO(sergey): This is an inverted relation, matches old depsgraph
- 		 * behavior and need to be investigated if it still need to be inverted.
- 		 */
- 		ComponentKey ob_pose_key(&object->id, DEG_NODE_TYPE_EVAL_POSE);
- 		ComponentKey proxy_pose_key(&object->proxy->id, DEG_NODE_TYPE_EVAL_POSE);
 -	/* Grease pencil. */
 -	if (object->gpd != NULL) {
 -		build_gpencil(object->gpd);
 -	}
+ 	/* Proxy object to copy from. */
+ 	if (object->proxy_from != NULL) {
+ 		build_object(NULL, object->proxy_from);
+ 		ComponentKey ob_pose_key(&object->proxy_from->id, DEG_NODE_TYPE_EVAL_POSE);
+ 		ComponentKey proxy_pose_key(&object->id, DEG_NODE_TYPE_EVAL_POSE);
  		add_relation(ob_pose_key, proxy_pose_key, "Proxy Pose");
  
- 		ComponentKey ob_transform_key(&object->id, DEG_NODE_TYPE_TRANSFORM);
- 		ComponentKey proxy_transform_key(&object->proxy->id, DEG_NODE_TYPE_TRANSFORM);
+ 		ComponentKey ob_transform_key(&object->proxy_from->id, DEG_NODE_TYPE_TRANSFORM);
+ 		ComponentKey proxy_transform_key(&object->id, DEG_NODE_TYPE_TRANSFORM);
  		add_relation(ob_transform_key, proxy_transform_key, "Proxy Transform");
  	}
+ 
  	/* Object dupligroup. */
  	if (object->dup_group != NULL) {
  		build_collection(object, object->dup_group);
diff --cc source/blender/makesrna/intern/rna_material.c
index de03486c281,9f5b72ff13e..4e8f1ffb655
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@@ -251,53 -243,9 +246,53 @@@ void rna_mtex_texture_slots_clear(ID *s
  	WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
  }
  
 +static void rna_gpcolordata_uv_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 +{
 +	/* update all uv strokes of this color */
 +	Material *ma = ptr->id.data;
 +	ED_gpencil_update_color_uv(bmain, ma);
 +
 +	rna_Material_update(bmain, scene, ptr);
 +}
 +
 +static char *rna_GpencilColorData_path(PointerRNA *UNUSED(ptr))
 +{
 +	return BLI_sprintfN("grease_pencil");
 +}
 +
 +static int rna_GpencilColorData_is_stroke_visible_get(PointerRNA *ptr)
 +{
 +	MaterialGPencilStyle *pcolor = ptr->data;
 +	return (pcolor->stroke_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH);
 +}
 +
 +static int rna_GpencilColorData_is_fill_visible_get(PointerRNA *ptr)
 +{
 +	MaterialGPencilStyle *pcolor = (MaterialGPencilStyle *)ptr->data;
 +	return ((pcolor->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (pcolor->fill_style > 0));
 +}
 +
 +static void rna_GpencilColorData_stroke_image_set(PointerRNA *ptr, PointerRNA value)
 +{
 +	MaterialGPencilStyle *pcolor = ptr->data;
 +	ID *id = value.data;
 +
 +	id_us_plus(id);
 +	pcolor->sima = (struct Image *)id;
 +}
 +
 +static void rna_GpencilColorData_fill_image_set(PointerRNA *ptr, PointerRNA value)
 +{
 +	MaterialGPencilStyle *pcolor = (MaterialGPencilStyle *)ptr->data;
 +	ID *id = value.data;
 +
 +	id_us_plus(id);
 +	pcolor->ima = (struct Image *)id;
 +}
 +
  #else
  
- static void rna_def_material_colors(StructRNA *srna)
+ static void rna_def_material_display(StructRNA *srna)
  {
  	PropertyRNA *prop;
  
@@@ -339,272 -296,6 +343,248 @@@
  	RNA_def_property_update(prop, 0, "rna_Material_update");
  }
  
- static void rna_def_material_raymirror(BlenderRNA *brna)
- {
- 	StructRNA *srna;
- 	PropertyRNA *prop;
- 
- 	srna = RNA_def_struct(brna, "MaterialRaytraceMirror", NULL);
- 	RNA_def_struct_sdna(srna, "Material");
- 	RNA_def_struct_nested(brna, srna, "Material");
- 	RNA_def_struct_ui_text(srna, "Material Raytrace Mirror", "Raytraced reflection settings for a Material data-block");
- 
- 	prop = RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR);
- 	RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
- 	RNA_def_property_range(prop, 0.0f, 1.0f);
- 	RNA_def_property_ui_text(prop, "Reflectivity", "Amount of mirror reflection for raytrace");
- 	RNA_def_property_update(prop, 0, "rna_Material_update");
- 	
- 	prop = RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
- 	RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
- 	RNA_def_property_range(prop, 0.0f, 1.0f);
- 	RNA_def_property_ui_text(prop, "Gloss Amount",
- 	                         "The shininess of the reflection (values < 1.0 give diffuse, blurry reflections)");
- 	RNA_def_property_update(prop, 0, "rna_Material_update");
- }
- 
 +static void rna_def_material_greasepencil(BlenderRNA *brna)
 +{
 +	StructRNA *srna;
 +	PropertyRNA *prop;
 +
 +	/* mode type styles */
 +	static EnumPropertyItem gpcolordata_mode_types_items[] = {
 +		{ GP_STYLE_MODE_LINE, "LINE", 0, "Line", "Draw strokes using a continuous line" },
 +		{ GP_STYLE_MODE_DOTS, "DOTS", 0, "Dots", "Draw strokes using separated dots" },
 +		{ GP_STYLE_MODE_BOX, "BOX", 0, "Boxes", "Draw strokes using separated rectangle boxes" },
 +		{ 0, NULL, 0, NULL, NULL }
 +	};
 +
 +	/* stroke styles */
 +	static EnumPropertyItem stroke_style_items[] = {
 +		{ GP_STYLE_STROKE_STYLE_SOLID, "SOLID", 0, "Solid", "Draw strokes with solid color" },
 +		{ GP_STYLE_STROKE_STYLE_TEXTURE, "TEXTURE", 0, "Texture", "Draw strokes using texture" },
 +		{ 0, NULL, 0, NULL, NULL }
 +	};
 +
 +	/* fill styles */
 +	static EnumPropertyItem fill_style_items[] = {
 +		{ GP_STYLE_FILL_STYLE_SOLID, "SOLID", 0, "Solid", "Fill area with solid color" },
 +		{ GP_STYLE_FILL_STYLE_GRADIENT, "GRADIENT", 0, "Gradient", "Fill area with gradient color" },
 +		{ GP_STYLE_FILL_STYLE_RADIAL, "RADIAL", 0, "Radial", "Fill area with radial gradient" },
 +		{ GP_STYLE_FILL_STYLE_CHESSBOARD, "CHESSBOARD", 0, "Checker Board", "Fill area with chessboard pattern" },
 +		{ GP_STYLE_FILL_STYLE_TEXTURE, "TEXTURE", 0, "Texture", "Fill area with image texture" },
 +		{ GP_STYLE_FILL_STYLE_PATTERN, "PATTERN", 0, "Pattern", "Fill area with color but use image texture as pattern to distribute color" },
 +		{ 0, NULL, 0, NULL, NULL }
 +	};
 +
 +	srna = RNA_def_struct(brna, "MaterialGPencilStyle", NULL);
 +	RNA_def_struct_sdna(srna, "MaterialGPencilStyle");
 +	RNA_def_struct_ui_text(srna, "Grease Pencil Color", "");
 +	RNA_def_struct_path_func(srna, "rna_GpencilColorData_path");
 +
 +	prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
 +	RNA_def_property_range(prop, 0.0, 1.0);
 +	RNA_def_property_float_sdna(prop, NULL, "stroke_rgba");
 +	RNA_def_property_array(prop, 3);
 +	RNA_def_property_ui_text(prop, "Color", "");
 +	RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_Material_update");
 +
 +	prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
 +	RNA_def_property_float_sdna(prop, NULL, "stroke_rgba[3]");
 +	RNA_def_property_range(prop, 0.0, 1.0f);
 +	RNA_def_property_ui_text(prop, "Opacity", "Color Opacity");
 +	RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_Material_update");
 +
 +	/* Fill Drawing Color */
 +	prop = RNA_def_property(srna, "fill_color", PROP_FLOAT, PROP_COLOR_GAMMA);
 +	RNA_def_property_float_sdna(prop, NULL, "fill_rgba");
 +	RNA_def_property_array(prop, 3);
 +	RNA_def_property_range(prop, 0.0f, 1.0f);
 +	RNA_def_property_ui_text(prop, "Fill Color", "Color for filling region bounded by each stroke");
 +	RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_Material_update");
 +
 +	/* Fill alpha */
 +	prop = RNA_def_property(srna, "fill_alpha", PROP_FLOAT, PROP_NONE);
 +	RNA_def_property_float_sdna(prop, NULL, "fill_rgba[3]");
 +	RNA_def_property_range(prop, 0.0, 1.0f);
 +	RNA_def_property_ui_text(prop, "Fill Opacity", "Opacity for filling region bounded by each stroke");
 +	RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_Material_update");
 +
 +	/* Secondary Drawing Color */
 +	prop = RNA_def_property(srna, "mix_color", PROP_FLOAT, PROP_COLOR_GAMMA);
 +	RNA_def_property_float_sdna(prop, NULL, "mix_rgba");
 +	RNA_def_property_array(prop, 4);
 +	RNA_def_property_range(prop, 0.0f, 1.0f);
 +	RNA_def_property_ui_text(prop, "Mix Color", "Color for mixing with primary filling color");
 +	RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_Material_update");
 +
 +	/* Mix factor */
 +	prop = RNA_def_property(srna, "mix_factor", PROP_FLOAT, PROP_NONE);
 +	RNA_def_property_float_sdna(prop, NULL, "mix_factor");
 +	RNA_def_property_range(prop, 0.0f, 1.0f);
 +	RNA_def_property_ui_text(prop, "Mix", "Mix Adjustment Factor");
 +	RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_Material_update");
 +
 +	/* Scale factor for uv coordinates */
 +	prop = RNA_def_property(srna, "pattern_scale", PROP_FLOAT, PROP_COORDS);
 +	RNA_def_property_float_sdna(prop, NULL, "gradient_scale");
 +	RNA_def_property_array(prop, 2);
 +	RNA_def_property_ui_text(prop, "Scale", "Scale Factor for UV coordinates");
 +	RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_Material_update");
 +
 +	/* Shift factor to move pattern filling in 2d space */
 +	prop = RNA_def_property(srna, "pattern_shift", PROP_FLOAT, PROP_COORDS);
 +	R

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list