diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-09 18:04:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-09 18:04:34 +0400 |
commit | 6cc6f8495f0dbf69afea98cbcde94ebb453b0783 (patch) | |
tree | 4f3352bdd590d352b7fb36903ea69d50935a2b99 /source/blender/editors | |
parent | 0ef243122032307f225033bc5454b6fe20fe09ad (diff) |
- added a flag argument to WM_operator_properties_filesel() currently only used for relative path option.
- added relative option to saving external multires data
- renamed multires external functiosn to have save / pack as suffix.
- added TODO's for file select operators that should support relative paths but dont.
- also disable openmp on linux cross compile, mingw currently isnt linking -lgomp
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editfont.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 31 | ||||
-rw-r--r-- | source/blender/editors/object/object_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/screendump.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sound/sound_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_info/info_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 4 |
14 files changed, 41 insertions, 42 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 37e695cf823..767c2c82594 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -417,7 +417,7 @@ void FONT_OT_file_paste(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE, 0); } /******************* paste buffer operator ********************/ @@ -1639,7 +1639,7 @@ void FONT_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE, 0); } /******************* delete operator *********************/ diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index f82b4e0324f..c6164fef8a8 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -157,8 +157,8 @@ void OBJECT_OT_modifier_copy(struct wmOperatorType *ot); void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot); void OBJECT_OT_multires_reshape(struct wmOperatorType *ot); void OBJECT_OT_multires_higher_levels_delete(struct wmOperatorType *ot); -void OBJECT_OT_multires_save_external(struct wmOperatorType *ot); -void OBJECT_OT_multires_pack_external(struct wmOperatorType *ot); +void OBJECT_OT_multires_external_save(struct wmOperatorType *ot); +void OBJECT_OT_multires_external_pack(struct wmOperatorType *ot); void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot); void OBJECT_OT_explode_refresh(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 697373ea923..c5c7d49d0a4 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1009,11 +1009,12 @@ void OBJECT_OT_multires_reshape(wmOperatorType *ot) /****************** multires save external operator *********************/ -static int multires_save_external_exec(bContext *C, wmOperator *op) +static int multires_external_save_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); Mesh *me= (ob)? ob->data: op->customdata; char path[FILE_MAX]; + int relative= RNA_boolean_get(op->ptr, "relative_path"); if(!me) return OPERATOR_CANCELLED; @@ -1023,7 +1024,8 @@ static int multires_save_external_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "path", path); - /* BLI_path_rel(path, G.sce); */ /* TODO, relative path operator option */ + if(relative) + BLI_path_rel(path, G.sce); CustomData_external_add(&me->fdata, &me->id, CD_MDISPS, me->totface, path); CustomData_external_write(&me->fdata, &me->id, CD_MASK_MESH, me->totface, 0); @@ -1031,7 +1033,7 @@ static int multires_save_external_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_save_external_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *event) { Object *ob = ED_object_active_context(C); MultiresModifierData *mmd; @@ -1049,8 +1051,11 @@ static int multires_save_external_invoke(bContext *C, wmOperator *op, wmEvent *e if(CustomData_external_test(&me->fdata, CD_MDISPS)) return OPERATOR_CANCELLED; + if(!RNA_property_is_set(op->ptr, "relative_path")) + RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); + if(RNA_property_is_set(op->ptr, "path")) - return multires_save_external_exec(C, op); + return multires_external_save_exec(C, op); op->customdata= me; @@ -1062,27 +1067,27 @@ static int multires_save_external_invoke(bContext *C, wmOperator *op, wmEvent *e return OPERATOR_RUNNING_MODAL; } -void OBJECT_OT_multires_save_external(wmOperatorType *ot) +void OBJECT_OT_multires_external_save(wmOperatorType *ot) { ot->name= "Multires Save External"; ot->description= "Save displacements to an external file"; - ot->idname= "OBJECT_OT_multires_save_external"; + ot->idname= "OBJECT_OT_multires_external_save"; // XXX modifier no longer in context after file browser .. ot->poll= multires_poll; - ot->exec= multires_save_external_exec; - ot->invoke= multires_save_external_invoke; + ot->exec= multires_external_save_exec; + ot->invoke= multires_external_save_invoke; ot->poll= multires_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE); + WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH); edit_modifier_properties(ot); } /****************** multires pack operator *********************/ -static int multires_pack_external_exec(bContext *C, wmOperator *op) +static int multires_external_pack_exec(bContext *C, wmOperator *op) { Object *ob = ED_object_active_context(C); Mesh *me= ob->data; @@ -1096,14 +1101,14 @@ static int multires_pack_external_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void OBJECT_OT_multires_pack_external(wmOperatorType *ot) +void OBJECT_OT_multires_external_pack(wmOperatorType *ot) { ot->name= "Multires Pack External"; ot->description= "Pack displacements from an external file"; - ot->idname= "OBJECT_OT_multires_pack_external"; + ot->idname= "OBJECT_OT_multires_external_pack"; ot->poll= multires_poll; - ot->exec= multires_pack_external_exec; + ot->exec= multires_external_pack_exec; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 274e8ff2d73..09fcd9432de 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -138,8 +138,8 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_multires_subdivide); WM_operatortype_append(OBJECT_OT_multires_reshape); WM_operatortype_append(OBJECT_OT_multires_higher_levels_delete); - WM_operatortype_append(OBJECT_OT_multires_save_external); - WM_operatortype_append(OBJECT_OT_multires_pack_external); + WM_operatortype_append(OBJECT_OT_multires_external_save); + WM_operatortype_append(OBJECT_OT_multires_external_pack); WM_operatortype_append(OBJECT_OT_meshdeform_bind); WM_operatortype_append(OBJECT_OT_explode_refresh); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index b6d819801c5..2a12b16be7c 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -913,9 +913,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot) /* properties */ //RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as."); - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE); - - RNA_def_boolean(ot->srna, "relative_path", 0, "Relative Path", "Save image with relative path to current .blend file"); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH); } static int envmap_clear_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 394f8b4fbcd..141a7c1c050 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -171,7 +171,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot) ot->flag= 0; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, 0); RNA_def_boolean(ot->srna, "full", 1, "Full Screen", ""); } diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 8f195b819ea..b4109692a4c 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -150,9 +150,8 @@ void SOUND_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); - RNA_def_boolean(ot->srna, "relative_path", FALSE, "Relative Path", "Load image with relative path to current .blend file"); } /* ******************************************************* */ diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 9261e28cd6a..ef7b3ce6d2a 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -147,6 +147,6 @@ void BUTTONS_OT_file_browse(wmOperatorType *ot) ot->cancel= file_browse_cancel; /* properties */ - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, 0); } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 9322bae13c9..c59b4783708 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1117,7 +1117,7 @@ void GRAPH_OT_sound_bake (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); RNA_def_float(ot->srna, "low", 0.0f, 0.0, 100000.0, "Lowest frequency", "", 0.1, 1000.00); RNA_def_float(ot->srna, "high", 100000.0, 0.0, 100000.0, "Highest frequency", "", 0.1, 1000.00); RNA_def_float(ot->srna, "attack", 0.005, 0.0, 2.0, "Attack time", "", 0.01, 0.1); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index fb9548001dc..3eeeb865ae4 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -754,9 +754,7 @@ void IMAGE_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); - - RNA_def_boolean(ot->srna, "relative_path", 0, "Relative Path", "Load image with relative path to current .blend file"); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, FILE_RELPATH); } /******************** replace image operator ********************/ @@ -809,7 +807,7 @@ void IMAGE_OT_replace(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path } /******************** save image as operator ********************/ @@ -997,9 +995,8 @@ void IMAGE_OT_save_as(wmOperatorType *ot) /* properties */ RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as."); - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH); - RNA_def_boolean(ot->srna, "relative_path", 0, "Relative Path", "Save image with relative path to current .blend file"); RNA_def_boolean(ot->srna, "copy", 0, "Copy", "Create a new image file without modifying the current image in blender"); } diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 64d2c6138c7..86d7d6bf014 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -299,7 +299,7 @@ void FILE_OT_find_missing_files(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, 0); } /********************* report box operator *********************/ @@ -397,4 +397,4 @@ void INFO_OT_reports_display_update(wmOperatorType *ot) ot->flag= 0; /* properties */ -}
\ No newline at end of file +} diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index befb37a2432..2fae8274951 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2304,7 +2304,7 @@ void NODE_OT_add_file(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign."); } diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index f36461ab7e0..7bd00e6081f 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -336,7 +336,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES); RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie"); } @@ -378,7 +378,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILES); RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); } @@ -469,7 +469,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME|SEQPROP_FILES); } @@ -617,7 +617,7 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME); RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type"); RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 8382e963523..d3c197506b9 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -295,7 +295,7 @@ void TEXT_OT_open(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE, 0); //XXX TODO, relative_path RNA_def_boolean(ot->srna, "internal", 0, "Make internal", "Make text file internal after loading"); } @@ -542,7 +542,7 @@ void TEXT_OT_save_as(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_SAVE); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_SAVE, 0); //XXX TODO, relative_path } /******************* run script operator *********************/ |