Merge branch 'master' into lib-link-rework-temp

This commit is contained in:
2015-09-22 09:49:24 +02:00
15 changed files with 130 additions and 104 deletions

View File

@@ -35,6 +35,8 @@ required-numpy: \
-- "$@" \
)
COMMANDLINE=$@
DISTRO=""
RPM=""
SRC="$HOME/src/blender-deps"
@@ -3120,6 +3122,10 @@ print_info() {
PRINT "Often, changes in the libs built by this script, or in your distro package, cannot be handled simply, so..."
PRINT ""
PRINT ""
PRINT "Ran with:"
PRINT " install_deps.sh $COMMANDLINE"
PRINT ""
PRINT ""
PRINT "If you're using CMake add this to your configuration flags:"
_buildargs=""

View File

@@ -1773,8 +1773,8 @@ static DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd,
}
else {
col[l_index].r =
col[l_index].g =
col[l_index].b = FTOCHAR(pPoint[v_index].wetness);
col[l_index].g =
col[l_index].b = FTOCHAR(pPoint[v_index].wetness);
col[l_index].a = 255;
}
}

View File

@@ -2174,8 +2174,8 @@ bool BKE_scene_use_new_shading_nodes(const Scene *scene)
bool BKE_scene_use_shading_nodes_custom(Scene *scene)
{
RenderEngineType *type = RE_engines_find(scene->r.engine);
return (type && type->flag & RE_USE_SHADING_NODES_CUSTOM);
RenderEngineType *type = RE_engines_find(scene->r.engine);
return (type && type->flag & RE_USE_SHADING_NODES_CUSTOM);
}
bool BKE_scene_uses_blender_internal(const Scene *scene)

View File

@@ -3570,8 +3570,8 @@ void perspective_m4(float mat[4][4], const float left, const float right, const
mat[2][3] = -1.0f;
mat[3][2] = (-2.0f * nearClip * farClip) / Zdelta;
mat[0][1] = mat[0][2] = mat[0][3] =
mat[1][0] = mat[1][2] = mat[1][3] =
mat[3][0] = mat[3][1] = mat[3][3] = 0.0f;
mat[1][0] = mat[1][2] = mat[1][3] =
mat[3][0] = mat[3][1] = mat[3][3] = 0.0f;
}

View File

@@ -929,7 +929,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
ob = obedit;
arm = (bArmature *)ob->data;
ebone_active = arm->act_edbone;
ebone_active = arm->act_edbone;
if (ebone_active == NULL) {
return OPERATOR_CANCELLED;
}

View File

@@ -3484,7 +3484,8 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
ui_abs = uiLayoutAbsolute(layout, false);
block = uiLayoutGetBlock(ui_abs);
width = BLF_width(style->widget.uifont_id, report->message, report->len);
UI_fontstyle_set(&style->widgetlabel);
width = BLF_width(style->widgetlabel.uifont_id, report->message, report->len);
width = min_ii((int)(rti->widthfac * width), width);
width = max_ii(width, 10);

View File

@@ -855,21 +855,15 @@ void getConstraintMatrix(TransInfo *t)
unit_m3(t->con.pmtx);
if (!(t->con.mode & CON_AXIS0)) {
t->con.pmtx[0][0] =
t->con.pmtx[0][1] =
t->con.pmtx[0][2] = 0.0f;
zero_v3(t->con.pmtx[0]);
}
if (!(t->con.mode & CON_AXIS1)) {
t->con.pmtx[1][0] =
t->con.pmtx[1][1] =
t->con.pmtx[1][2] = 0.0f;
zero_v3(t->con.pmtx[1]);
}
if (!(t->con.mode & CON_AXIS2)) {
t->con.pmtx[2][0] =
t->con.pmtx[2][1] =
t->con.pmtx[2][2] = 0.0f;
zero_v3(t->con.pmtx[2]);
}
mul_m3_m3m3(mat, t->con.pmtx, t->con.imtx);

View File

@@ -343,12 +343,12 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animStart");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)");
prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "animEnd");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_range(prop, 0, FLT_MAX);
RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)");
prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
@@ -627,12 +627,12 @@ static void rna_def_fluidsim_control(BlenderRNA *brna)
prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeStart");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_text(prop, "Start Time", "Time when the control particles are activated");
prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "cpsTimeEnd");
RNA_def_property_range(prop, 0.0, 100.0);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_text(prop, "End Time", "Time when the control particles are deactivated");
prop = RNA_def_property(srna, "attraction_strength", PROP_FLOAT, PROP_NONE);

View File

@@ -106,6 +106,9 @@
#include "GPU_draw.h"
/* only to report a missing engine */
#include "RE_engine.h"
#ifdef WITH_PYTHON
#include "BPY_extern.h"
#endif
@@ -401,6 +404,89 @@ void WM_file_autoexec_init(const char *filepath)
}
}
void wm_file_read_report(bContext *C)
{
ReportList *reports = NULL;
Scene *sce;
for (sce = G.main->scene.first; sce; sce = sce->id.next) {
if (sce->r.engine[0] &&
BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL)
{
if (reports == NULL) {
reports = CTX_wm_reports(C);
}
BKE_reportf(reports, RPT_ERROR,
"Engine '%s' not available for scene '%s' "
"(an addon may need to be installed or enabled)",
sce->r.engine, sce->id.name + 2);
}
}
if (reports) {
if (!G.background) {
WM_report_banner_show(C);
}
}
}
/**
* Logic shared between #WM_file_read & #wm_homefile_read,
* updates to make after reading a file.
*/
static void wm_file_read_post(bContext *C, bool is_startup_file)
{
bool addons_loaded = false;
CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
ED_editors_init(C);
DAG_on_visible_update(CTX_data_main(C), true);
#ifdef WITH_PYTHON
if (is_startup_file) {
/* possible python hasn't been initialized */
if (CTX_py_init_get(C)) {
/* sync addons, these may have changed from the defaults */
BPY_string_exec(C, "__import__('addon_utils').reset_all()");
BPY_python_reset(C);
addons_loaded = true;
}
}
else {
/* run any texts that were loaded in and flagged as modules */
BPY_python_reset(C);
addons_loaded = true;
}
#endif /* WITH_PYTHON */
WM_operatortype_last_properties_clear_all();
/* important to do before NULL'ing the context */
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL);
/* report any errors.
* currently disabled if addons aren't yet loaded */
if (addons_loaded) {
wm_file_read_report(C);
}
if (!G.background) {
/* in background mode this makes it hard to load
* a blend file and do anything since the screen
* won't be set to a valid value again */
CTX_wm_window_set(C, NULL); /* exits queues */
}
// undo_editmode_clear();
BKE_undo_reset();
BKE_undo_write(C, "original"); /* save current state */
}
bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
{
/* assume automated tasks with background, don't write recent file list */
@@ -465,53 +551,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
}
}
WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL);
// refresh_interface_font();
CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
ED_editors_init(C);
DAG_on_visible_update(CTX_data_main(C), true);
#ifdef WITH_PYTHON
/* run any texts that were loaded in and flagged as modules */
BPY_python_reset(C);
#endif
WM_operatortype_last_properties_clear_all();
/* important to do before NULL'ing the context */
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
if (!G.background) {
/* in background mode this makes it hard to load
* a blend file and do anything since the screen
* won't be set to a valid value again */
CTX_wm_window_set(C, NULL); /* exits queues */
}
#if 0
/* gives popups on windows but not linux, bug in report API
* but disable for now to stop users getting annoyed */
/* TODO, make this show in header info window */
{
Scene *sce;
for (sce = G.main->scene.first; sce; sce = sce->id.next) {
if (sce->r.engine[0] &&
BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL)
{
BKE_reportf(reports, RPT_ERROR, "Engine '%s' not available for scene '%s' "
"(an addon may need to be installed or enabled)",
sce->r.engine, sce->id.name + 2);
}
}
}
#endif
BKE_undo_reset();
BKE_undo_write(C, "original"); /* save current state */
wm_file_read_post(C, false);
success = true;
}
@@ -673,36 +713,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
G.save_over = 0; // start with save preference untitled.blend
G.fileflags &= ~G_FILE_AUTOPLAY; /* disable autoplay in startup.blend... */
// refresh_interface_font();
// undo_editmode_clear();
BKE_undo_reset();
BKE_undo_write(C, "original"); /* save current state */
ED_editors_init(C);
DAG_on_visible_update(CTX_data_main(C), true);
#ifdef WITH_PYTHON
if (CTX_py_init_get(C)) {
/* sync addons, these may have changed from the defaults */
BPY_string_exec(C, "__import__('addon_utils').reset_all()");
BPY_python_reset(C);
}
#endif
WM_operatortype_last_properties_clear_all();
/* important to do before NULL'ing the context */
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL);
/* in background mode the scene will stay NULL */
if (!G.background) {
CTX_wm_window_set(C, NULL); /* exits queues */
}
wm_file_read_post(C, true);
return true;
}

View File

@@ -174,6 +174,10 @@ void WM_init(bContext *C, int argc, const char **argv)
/* Enforce loading the UI for the initial homefile */
G.fileflags &= ~G_FILE_NO_UI;
/* reports cant be initialized before the wm,
* but keep before file reading, since that may report errors */
wm_init_reports(C);
/* get the default database, plus a wm */
wm_homefile_read(C, NULL, G.factory_startup, NULL);
@@ -229,8 +233,6 @@ void WM_init(bContext *C, int argc, const char **argv)
if (!G.background && !wm_start_with_console)
GHOST_toggleConsole(3);
wm_init_reports(C); /* reports cant be initialized before the wm */
clear_matcopybuf();
ED_render_clear_mtex_copybuf();
@@ -259,13 +261,24 @@ void WM_init(bContext *C, int argc, const char **argv)
/* that prevents loading both the kept session, and the file on the command line */
}
else {
/* note, logic here is from wm_file_read_post,
* call functions that depend on Python being initialized. */
/* normally 'wm_homefile_read' will do this,
* however python is not initialized when called from this function.
*
* unlikely any handlers are set but its possible,
* note that recovering the last session does its own callbacks. */
CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first);
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
wm_file_read_report(C);
if (!G.background) {
CTX_wm_window_set(C, NULL);
}
}
}

View File

@@ -1278,7 +1278,7 @@ void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *t
wmTimer *WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)
{
wmTimer *wt = MEM_callocN(sizeof(wmTimer), "window timer");
wt->event_type = event_type;
wt->ltime = PIL_check_seconds_timer();
wt->ntime = wt->ltime + timestep;

View File

@@ -38,6 +38,7 @@ int wm_homefile_read_exec(struct bContext *C, struct wmOperator *op);
int wm_homefile_read(struct bContext *C, struct ReportList *reports, bool from_memory, const char *filepath);
int wm_homefile_write_exec(struct bContext *C, struct wmOperator *op);
int wm_userpref_write_exec(struct bContext *C, struct wmOperator *op);
void wm_file_read_report(bContext *C);
#endif /* __WM_FILES_H__ */