[Bf-blender-cvs] [5f08c4e8195] soc-2018-npr: implemented set() for active_layer but still.

Nick Wu noreply at git.blender.org
Wed Jun 20 16:37:35 CEST 2018


Commit: 5f08c4e819522ba27cf2c56f69fab5620211c338
Author: Nick Wu
Date:   Wed Jun 20 22:37:10 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB5f08c4e819522ba27cf2c56f69fab5620211c338

implemented set() for active_layer but still.

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

M	release/scripts/startup/bl_ui/properties_scene.py
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index fbd01137da8..22b4f4809c2 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -499,7 +499,7 @@ class SCENE_PT_lanpr(SceneButtonsPanel, PropertyPanel, Panel):
         layout = self.layout
         scene = context.scene
         lanpr = scene.lanpr
-        active_layer = lanpr.layer.active_layer #this is alwas none.
+        active_layer = lanpr.layers.active_layer #this is alwas none.
 
         layout.prop(lanpr, "master_mode", expand=True) 
 
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index a75fbbd173e..770118f56fa 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2141,6 +2141,12 @@ PointerRNA rna_lanpr_active_line_layer_get(PointerRNA *ptr)
 	return rna_pointer_inherit_refine(ptr, &RNA_LANPR_LineStyle, ls);
 }
 
+void rna_lanpr_active_line_layer_set(PointerRNA *ptr, PointerRNA value)
+{
+	SceneLANPR *lanpr = (SceneLANPR *)ptr->data;
+	lanpr->active_layer = value.data;
+}
+
 #else
 
 /* Grease Pencil Interpolation tool settings */
@@ -6438,7 +6444,7 @@ static void rna_def_scene_lanpr(BlenderRNA *brna)
     /* this part when accessing in python using lanpr.layers.active_layer always return None */
 	prop = RNA_def_property(srna, "active_layer", PROP_POINTER, PROP_NONE);
 	RNA_def_property_struct_type(prop, "LANPR_LineStyle");
-	RNA_def_property_pointer_funcs(prop, "rna_lanpr_active_line_layer_get", NULL, NULL, NULL);
+	RNA_def_property_pointer_funcs(prop, "rna_lanpr_active_line_layer_get", "rna_lanpr_active_line_layer_set", NULL, NULL);
 	RNA_def_property_ui_text(prop, "Active Line Layer", "Active line layer being displayed");
 	RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);



More information about the Bf-blender-cvs mailing list