merges changes to revision 23820
authorMaxime Curioni <maxime.curioni@gmail.com>
Wed, 14 Oct 2009 06:08:48 +0000 (06:08 +0000)
committerMaxime Curioni <maxime.curioni@gmail.com>
Wed, 14 Oct 2009 06:08:48 +0000 (06:08 +0000)
13 files changed:
1  2 
release/scripts/ui/buttons_scene.py
source/blender/blenkernel/intern/blender.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/render/render_intern.h
source/blender/editors/render/render_ops.c
source/blender/editors/render/render_shading.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_scene.c
source/blender/python/intern/bpy_interface.c
source/blender/windowmanager/intern/wm_files.c
source/creator/creator.c

Simple merge
index e62bc175416f38c4aed73822d4af8335f8bfd690,7b4c0194c5d9e217a0979065cfc3302dcd81e3e0..29b3f9ef5c9e7655732fd048383b97949dee1767
@@@ -44,10 -45,9 +45,13 @@@ void WORLD_OT_new(struct wmOperatorTyp
  
  void SCENE_OT_render_layer_add(struct wmOperatorType *ot);
  void SCENE_OT_render_layer_remove(struct wmOperatorType *ot);
 +void SCENE_OT_freestyle_module_add(struct wmOperatorType *ot);
 +void SCENE_OT_freestyle_module_remove(struct wmOperatorType *ot);
 +void SCENE_OT_freestyle_module_move_up(struct wmOperatorType *ot);
 +void SCENE_OT_freestyle_module_move_down(struct wmOperatorType *ot);
  
+ void TEXTURE_OT_slot_move(struct wmOperatorType *ot);
  #endif /* RENDER_INTERN_H */
  
index 7935b4f248b0af885da1929ed3686dda1215f3c1,8c0c1b18fca0ec5ffad111b2e7c0be1c7ad492dc..9d2e8e618cbbde062b61d8edd734cd57040aaaca
@@@ -50,9 -51,7 +51,12 @@@ void ED_operatortypes_render(void
  
        WM_operatortype_append(SCENE_OT_render_layer_add);
        WM_operatortype_append(SCENE_OT_render_layer_remove);
 +      WM_operatortype_append(SCENE_OT_freestyle_module_add);
 +      WM_operatortype_append(SCENE_OT_freestyle_module_remove);
 +      WM_operatortype_append(SCENE_OT_freestyle_module_move_up);
 +      WM_operatortype_append(SCENE_OT_freestyle_module_move_down);
++
+       WM_operatortype_append(TEXTURE_OT_slot_move);
  }
  
index 815bc8cee0bb8d10235e8331e90dafaa9b096bfa,a90231942711112365bcfb17e612dd830e72ce77..b00cf6c13f1d33ac07d6dfa5104302d4a8dd564c
@@@ -645,122 -681,78 +683,198 @@@ void SCENE_OT_render_layer_remove(wmOpe
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
  }
  
 +static int freestyle_module_add_exec(bContext *C, wmOperator *op)
 +{
 +      Scene *scene= CTX_data_scene(C);
 +
 +      printf("freestyle_module_add_exec\n");
 +      FRS_add_module();
 +
 +      WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +void SCENE_OT_freestyle_module_add(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Add Freestyle Module";
 +      ot->idname= "SCENE_OT_freestyle_module_add";
 +      ot->description="Add a style module into the list of modules.";
 +      
 +      /* api callbacks */
 +      ot->exec= freestyle_module_add_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +}
 +
 +static int freestyle_module_remove_exec(bContext *C, wmOperator *op)
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      PointerRNA ptr= CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
 +      FreestyleModuleConfig *module= ptr.data;
 +
 +      printf("freestyle_module_remove_exec\n");
 +      FRS_delete_module(module, NULL);
 +
 +      WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +void SCENE_OT_freestyle_module_remove(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Remove Freestyle Module";
 +      ot->idname= "SCENE_OT_freestyle_module_remove";
 +      ot->description="Remove the style module from the stack.";
 +      
 +      /* api callbacks */
 +      ot->exec= freestyle_module_remove_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +}
 +
 +static int freestyle_module_move_up_exec(bContext *C, wmOperator *op)
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      PointerRNA ptr= CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
 +      FreestyleModuleConfig *module= ptr.data;
 +      int active = RNA_boolean_get(op->ptr, "active");
 +
 +      printf("freestyle_module_move_up_exec\n");
 +      if(active)
 +              FRS_move_up_module(module, NULL);
 +
 +      WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +void SCENE_OT_freestyle_module_move_up(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Move Up Freestyle Module";
 +      ot->idname= "SCENE_OT_freestyle_module_move_up";
 +      ot->description="Move the style module up in the stack.";
 +      
 +      /* api callbacks */
 +      ot->exec= freestyle_module_move_up_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +
 +      /* props */
 +      RNA_def_boolean(ot->srna, "active", 0, "Active", "True if the operator is enabled.");
 +}
 +
 +static int freestyle_module_move_down_exec(bContext *C, wmOperator *op)
 +{
 +      Scene *scene= CTX_data_scene(C);
 +      PointerRNA ptr= CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
 +      FreestyleModuleConfig *module= ptr.data;
 +      int active = RNA_boolean_get(op->ptr, "active");
 +
 +      printf("freestyle_module_move_down_exec\n");
 +      if(active)
 +              FRS_move_down_module(module, NULL);
 +
 +      WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +void SCENE_OT_freestyle_module_move_down(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Move Down Freestyle Module";
 +      ot->idname= "SCENE_OT_freestyle_module_move_down";
 +      ot->description="Move the style module down in the stack.";
 +      
 +      /* api callbacks */
 +      ot->exec= freestyle_module_move_down_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +
 +      /* props */
 +      RNA_def_boolean(ot->srna, "active", 0, "Active", "True if the operator is enabled.");
 +}
++
+ static int texture_slot_move(bContext *C, wmOperator *op)
+ {
+       ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
+       if(id) {
+               MTex **mtex_ar, *mtexswap;
+               short act;
+               int type= RNA_enum_get(op->ptr, "type");
+               give_active_mtex(id, &mtex_ar, &act);
+               if(type == -1) { /* Up */
+                       if(act > 0) {
+                               mtexswap = mtex_ar[act];
+                               mtex_ar[act] = mtex_ar[act-1];
+                               mtex_ar[act-1] = mtexswap;
+                               if(GS(id->name)==ID_MA) {
+                                       Material *ma= (Material *)id;
+                                       int mtexuse = ma->septex & (1<<act);
+                                       ma->septex &= ~(1<<act);
+                                       ma->septex |= (ma->septex & (1<<(act-1))) << 1;
+                                       ma->septex &= ~(1<<(act-1));
+                                       ma->septex |= mtexuse >> 1;
+                               }
+                               set_active_mtex(id, act-1);
+                       }
+               }
+               else { /* Down */
+                       if(act < MAX_MTEX-1) {
+                               mtexswap = mtex_ar[act];
+                               mtex_ar[act] = mtex_ar[act+1];
+                               mtex_ar[act+1] = mtexswap;
+                               if(GS(id->name)==ID_MA) {
+                                       Material *ma= (Material *)id;
+                                       int mtexuse = ma->septex & (1<<act);
+                                       ma->septex &= ~(1<<act);
+                                       ma->septex |= (ma->septex & (1<<(act+1))) >> 1;
+                                       ma->septex &= ~(1<<(act+1));
+                                       ma->septex |= mtexuse << 1;
+                               }
+                               set_active_mtex(id, act+1);
+                       }
+               }
+               WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
+       }
+       return OPERATOR_FINISHED;
+ }
+ void TEXTURE_OT_slot_move(wmOperatorType *ot)
+ {
+       static EnumPropertyItem slot_move[] = {
+               {-1, "UP", 0, "Up", ""},
+               {1, "DOWN", 0, "Down", ""},
+               {0, NULL, 0, NULL, NULL}
+       };
+       /* identifiers */
+       ot->name= "Move Texture Slot";
+       ot->idname= "TEXTURE_OT_slot_move";
+       ot->description="Move texture slots up and down.";
+       /* api callbacks */
+       ot->exec= texture_slot_move;
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       RNA_def_enum(ot->srna, "type", slot_move, 0, "Type", "");
+ }
index 05a17f5eefdc4872bad5fdd5bd503d7684b2943a,810fb110f7a0add232fe8484257be46a9b1e30b6..1306d4bbcc3bd58bc140045a138caaafc78ffb84
@@@ -203,8 -210,11 +210,12 @@@ extern StructRNA RNA_FluidFluidSettings
  extern StructRNA RNA_FluidSettings;
  extern StructRNA RNA_FluidSimulationModifier;
  extern StructRNA RNA_FollowPathConstraint;
 +extern StructRNA RNA_FreestyleModuleSettings;
  extern StructRNA RNA_Function;
+ extern StructRNA RNA_GPencilFrame;
+ extern StructRNA RNA_GPencilLayer;
+ extern StructRNA RNA_GPencilStroke;
+ extern StructRNA RNA_GPencilStrokePoint;
  extern StructRNA RNA_GameBooleanProperty;
  extern StructRNA RNA_GameFloatProperty;
  extern StructRNA RNA_GameIntProperty;
index c1d2cd802ec72a14b1288ba07597163cfea02c9b,d254c7c9eee271ea7d04dde14cb68ea672058200..2b60a35242bc83a561ae7d0aefee2e1c6641008f
@@@ -2322,13 -2308,13 +2386,19 @@@ void RNA_def_scene(BlenderRNA *brna
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_struct_type(prop, "GreasePencil");
        RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
 +
 +      /* Freestyle */
 +      prop= RNA_def_property(srna, "freestyle_current_layer_number", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "freestyle_current_layer_number");
 +      RNA_def_property_ui_text(prop, "Freestyle Current Layer Number", "Number of current layers in Freestyle.");
 +      RNA_def_property_update(prop, NC_SCENE, NULL);
        
+       /* Transform Orientations */
+       prop= RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
+       RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL);
+       RNA_def_property_struct_type(prop, "TransformOrientation");
+       RNA_def_property_ui_text(prop, "Transform Orientations", "");
        /* Nestled Data  */
        rna_def_tool_settings(brna);
        rna_def_unit_settings(brna);
Simple merge