Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 394871 | Differences between
and this patch

Collapse All | Expand All

(-)blender-2.63.orig/build_files/scons/tools/btools.py (-1 / +2 lines)
Lines 96-102 def print_arguments(args, bc): Link Here
96
96
97
def validate_arguments(args, bc):
97
def validate_arguments(args, bc):
98
    opts_list = [
98
    opts_list = [
99
            'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 
99
            'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 'WITH_PYTHON_SECURITY',
100
            'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
100
            'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
101
            'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
101
            'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
102
            'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH',
102
            'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH',
Lines 261-266 def read_opts(env, cfg, args): Link Here
261
        (BoolVariable('WITH_BF_STATICPYTHON', 'Staticly link to python', False)),
261
        (BoolVariable('WITH_BF_STATICPYTHON', 'Staticly link to python', False)),
262
        (BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
262
        (BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
263
        ('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
263
        ('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
264
        (BoolVariable('WITH_PYTHON_SECURITY', 'Disables execution of scripts within blend files by default (recommend to leave off)', False)),
264
265
265
        (BoolVariable('WITH_BF_FLUID', 'Build with Fluid simulation (Elbeem)', True)),
266
        (BoolVariable('WITH_BF_FLUID', 'Build with Fluid simulation (Elbeem)', True)),
266
        (BoolVariable('WITH_BF_DECIMATE', 'Build with decimate modifier', True)),
267
        (BoolVariable('WITH_BF_DECIMATE', 'Build with decimate modifier', True)),
(-)blender-2.63.orig/SConstruct (+4 lines)
Lines 349-354 if 'blenderplayer' in B.targets: Link Here
349
if 'blendernogame' in B.targets:
349
if 'blendernogame' in B.targets:
350
    env['WITH_BF_GAMEENGINE'] = False
350
    env['WITH_BF_GAMEENGINE'] = False
351
351
352
# build without python autoexec security?
353
if env['WITH_PYTHON_SECURITY'] == True:
354
    env.Append(CPPFLAGS=['-DWITH_PYTHON_SECURITY'])
355
352
# build without elbeem (fluidsim)?
356
# build without elbeem (fluidsim)?
353
if env['WITH_BF_FLUID'] == 1:
357
if env['WITH_BF_FLUID'] == 1:
354
    env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
358
    env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
(-)blender-2.63.orig/source/blender/blenkernel/intern/blender.c (+1 lines)
Lines 145-150 void initglobals(void) Link Here
145
	G.f |= G_SCRIPT_AUTOEXEC;
145
	G.f |= G_SCRIPT_AUTOEXEC;
146
#else
146
#else
147
	G.f &= ~G_SCRIPT_AUTOEXEC;
147
	G.f &= ~G_SCRIPT_AUTOEXEC;
148
	G.f |= G_SCRIPT_OVERRIDE_PREF;  /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
148
#endif
149
#endif
149
}
150
}
150
151
(-)blender-2.63.orig/source/blender/makesrna/intern/rna_userdef.c (-3 / +13 lines)
Lines 126-134 static void rna_userdef_show_manipulator Link Here
126
126
127
static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
127
static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
128
{
128
{
129
	UserDef *userdef = (UserDef*)ptr->data;
129
	if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
130
	if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE)	G.f &= ~G_SCRIPT_AUTOEXEC;
130
		/* Blender run with --enable-autoexec */
131
	else												G.f |=  G_SCRIPT_AUTOEXEC;
131
		UserDef *userdef = (UserDef*)ptr->data;
132
		if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE)       G.f &= ~G_SCRIPT_AUTOEXEC;
133
		else                                                                                            G.f |=  G_SCRIPT_AUTOEXEC;
134
	}
135
}
136
137
static int rna_userdef_script_autoexec_editable(Main *bmain, Scene *scene, PointerRNA *ptr) {
138
	/* Disable "Auto Run Python Scripts" checkbox unless Blender run with --enable-autoexec */
139
	return !(G.f & G_SCRIPT_OVERRIDE_PREF);
132
}
140
}
133
141
134
static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
142
static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
Lines 2994-2999 static void rna_def_userdef_system(Blend Link Here
2994
	                         "Allow any .blend file to run scripts automatically "
3002
	                         "Allow any .blend file to run scripts automatically "
2995
	                         "(unsafe with blend files from an untrusted source)");
3003
	                         "(unsafe with blend files from an untrusted source)");
2996
	RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
3004
	RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
3005
	/* Disable "Auto Run Python Scripts" checkbox unless Blender run with --enable-autoexec */
3006
	RNA_def_property_editable_func(prop, "rna_userdef_script_autoexec_editable");
2997
3007
2998
	prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
3008
	prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
2999
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
3009
	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
(-)blender-2.63.orig/source/blender/windowmanager/intern/wm_files.c (-1 / +6 lines)
Lines 288-300 static void wm_init_userdef(bContext *C) Link Here
288
288
289
	/* set the python auto-execute setting from user prefs */
289
	/* set the python auto-execute setting from user prefs */
290
	/* enabled by default, unless explicitly enabled in the command line which overrides */
290
	/* enabled by default, unless explicitly enabled in the command line which overrides */
291
	if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
291
	if (! G.background && ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0)) {
292
		/* Blender run with --enable-autoexec */
292
		if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |=  G_SCRIPT_AUTOEXEC;
293
		if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |=  G_SCRIPT_AUTOEXEC;
293
		else G.f &= ~G_SCRIPT_AUTOEXEC;
294
		else G.f &= ~G_SCRIPT_AUTOEXEC;
294
	}
295
	}
295
296
296
	/* update tempdir from user preferences */
297
	/* update tempdir from user preferences */
297
	BLI_init_temporary_dir(U.tempdir);
298
	BLI_init_temporary_dir(U.tempdir);
299
300
	/* Workaround to fix default of "Auto Run Python Scripts" checkbox */
301
	if ((G.f & G_SCRIPT_OVERRIDE_PREF) && !(G.f & G_SCRIPT_AUTOEXEC))
302
		U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;
298
}
303
}
299
304
300
305
(-)blender-2.63.orig/source/blender/windowmanager/intern/wm_operators.c (-4 / +11 lines)
Lines 1627-1638 static int wm_open_mainfile_exec(bContex Link Here
1627
		G.fileflags &= ~G_FILE_NO_UI;
1627
		G.fileflags &= ~G_FILE_NO_UI;
1628
	else
1628
	else
1629
		G.fileflags |= G_FILE_NO_UI;
1629
		G.fileflags |= G_FILE_NO_UI;
1630
		
1630
1631
	if (RNA_boolean_get(op->ptr, "use_scripts"))
1631
	/* Restrict "Trusted Source" mode to Blender in --enable-autoexec mode */
1632
	if(RNA_boolean_get(op->ptr, "use_scripts") && (!(G.f & G_SCRIPT_OVERRIDE_PREF)))
1632
		G.f |= G_SCRIPT_AUTOEXEC;
1633
		G.f |= G_SCRIPT_AUTOEXEC;
1633
	else
1634
	else
1634
		G.f &= ~G_SCRIPT_AUTOEXEC;
1635
		G.f &= ~G_SCRIPT_AUTOEXEC;
1635
	
1636
1636
	// XXX wm in context is not set correctly after WM_read_file -> crash
1637
	// XXX wm in context is not set correctly after WM_read_file -> crash
1637
	// do it before for now, but is this correct with multiple windows?
1638
	// do it before for now, but is this correct with multiple windows?
1638
	WM_event_add_notifier(C, NC_WINDOW, NULL);
1639
	WM_event_add_notifier(C, NC_WINDOW, NULL);
Lines 1644-1649 static int wm_open_mainfile_exec(bContex Link Here
1644
1645
1645
static void WM_OT_open_mainfile(wmOperatorType *ot)
1646
static void WM_OT_open_mainfile(wmOperatorType *ot)
1646
{
1647
{
1648
	PropertyRNA * use_scripts_checkbox = NULL;
1649
1647
	ot->name = "Open Blender File";
1650
	ot->name = "Open Blender File";
1648
	ot->idname = "WM_OT_open_mainfile";
1651
	ot->idname = "WM_OT_open_mainfile";
1649
	ot->description = "Open a Blender file";
1652
	ot->description = "Open a Blender file";
Lines 1656-1663 static void WM_OT_open_mainfile(wmOperat Link Here
1656
	                               WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
1659
	                               WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
1657
1660
1658
	RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file");
1661
	RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file");
1659
	RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source",
1662
	use_scripts_checkbox = RNA_def_boolean(ot->srna, "use_scripts",
1663
			!!(G.f & G_SCRIPT_AUTOEXEC), "Trusted Source",
1660
	                "Allow .blend file to execute scripts automatically, default available from system preferences");
1664
	                "Allow .blend file to execute scripts automatically, default available from system preferences");
1665
	/* Disable "Trusted Source" checkbox unless Blender run with --enable-autoexec */
1666
	if (use_scripts_checkbox && (G.f & G_SCRIPT_OVERRIDE_PREF))
1667
	        RNA_def_property_clear_flag(use_scripts_checkbox, PROP_EDITABLE);
1661
}
1668
}
1662
1669
1663
/* **************** link/append *************** */
1670
/* **************** link/append *************** */
(-)blender-2.63.orig/source/creator/creator.c (-2 / +2 lines)
Lines 342-355 static int end_arguments(int UNUSED(argc Link Here
342
static int enable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
342
static int enable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
343
{
343
{
344
	G.f |= G_SCRIPT_AUTOEXEC;
344
	G.f |= G_SCRIPT_AUTOEXEC;
345
	G.f |= G_SCRIPT_OVERRIDE_PREF;
345
	G.f &= ~G_SCRIPT_OVERRIDE_PREF;  /* Enables turning G_SCRIPT_AUTOEXEC off from user prefs */
346
	return 0;
346
	return 0;
347
}
347
}
348
348
349
static int disable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
349
static int disable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
350
{
350
{
351
	G.f &= ~G_SCRIPT_AUTOEXEC;
351
	G.f &= ~G_SCRIPT_AUTOEXEC;
352
	G.f |= G_SCRIPT_OVERRIDE_PREF;
352
	G.f |= G_SCRIPT_OVERRIDE_PREF;  /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
353
	return 0;
353
	return 0;
354
}
354
}
355
355

Return to bug 394871