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

Collapse All | Expand All

(-)a/source/blender/blenkernel/intern/blender.c (-1 / +2 lines)
Lines 141-147 void initglobals(void) Link Here
141
	G.charmin = 0x0000;
141
	G.charmin = 0x0000;
142
	G.charmax = 0xffff;
142
	G.charmax = 0xffff;
143
	
143
	
144
	G.f |= G_SCRIPT_AUTOEXEC;
144
	G.f &= ~G_SCRIPT_AUTOEXEC;
145
	G.f |= G_SCRIPT_OVERRIDE_PREF;  /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
145
}
146
}
146
147
147
/***/
148
/***/
(-)a/source/blender/makesrna/intern/rna_userdef.c (-3 / +6 lines)
Lines 99-107 static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point Link Here
99
99
100
static void rna_userdef_script_autoexec_update(Main *bmain, Scene *scene, PointerRNA *ptr)
100
static void rna_userdef_script_autoexec_update(Main *bmain, Scene *scene, PointerRNA *ptr)
101
{
101
{
102
	UserDef *userdef = (UserDef*)ptr->data;
102
	if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
103
	if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE)	G.f &= ~G_SCRIPT_AUTOEXEC;
103
		/* Blender run with --enable-autoexec */
104
	else												G.f |=  G_SCRIPT_AUTOEXEC;
104
		UserDef *userdef = (UserDef*)ptr->data;
105
		if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE)	G.f &= ~G_SCRIPT_AUTOEXEC;
106
		else												G.f |=  G_SCRIPT_AUTOEXEC;
107
	}
105
}
108
}
106
109
107
static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
110
static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
(-)a/source/blender/windowmanager/intern/wm_files.c (-1 / +2 lines)
Lines 270-276 static void wm_init_userdef(bContext *C) Link Here
270
270
271
	/* set the python auto-execute setting from user prefs */
271
	/* set the python auto-execute setting from user prefs */
272
	/* enabled by default, unless explicitly enabled in the command line which overrides */
272
	/* enabled by default, unless explicitly enabled in the command line which overrides */
273
	if((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) {
273
	if (! G.background && ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0)) {
274
		/* Blender run with --enable-autoexec */
274
		if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |=  G_SCRIPT_AUTOEXEC;
275
		if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |=  G_SCRIPT_AUTOEXEC;
275
		else											  G.f &= ~G_SCRIPT_AUTOEXEC;
276
		else											  G.f &= ~G_SCRIPT_AUTOEXEC;
276
	}
277
	}
(-)a/source/creator/creator.c (-5 / +6 lines)
Lines 278-283 static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data) Link Here
278
278
279
	printf("\n");
279
	printf("\n");
280
280
281
	BLI_argsPrintArgDoc(ba, "-666");
281
	BLI_argsPrintArgDoc(ba, "--enable-autoexec");
282
	BLI_argsPrintArgDoc(ba, "--enable-autoexec");
282
	BLI_argsPrintArgDoc(ba, "--disable-autoexec");
283
	BLI_argsPrintArgDoc(ba, "--disable-autoexec");
283
284
Lines 359-372 static int end_arguments(int UNUSED(argc), const char **UNUSED(argv), void *UNUS Link Here
359
static int enable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
360
static int enable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
360
{
361
{
361
	G.f |= G_SCRIPT_AUTOEXEC;
362
	G.f |= G_SCRIPT_AUTOEXEC;
362
	G.f |= G_SCRIPT_OVERRIDE_PREF;
363
	G.f &= ~G_SCRIPT_OVERRIDE_PREF;  /* Enables turning G_SCRIPT_AUTOEXEC off from user prefs */
363
	return 0;
364
	return 0;
364
}
365
}
365
366
366
static int disable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
367
static int disable_python(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
367
{
368
{
368
	G.f &= ~G_SCRIPT_AUTOEXEC;
369
	G.f &= ~G_SCRIPT_AUTOEXEC;
369
	G.f |= G_SCRIPT_OVERRIDE_PREF;
370
	G.f |= G_SCRIPT_OVERRIDE_PREF;  /* Disables turning G_SCRIPT_AUTOEXEC on from user prefs */
370
	return 0;
371
	return 0;
371
}
372
}
372
373
Lines 1075-1082 static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) Link Here
1075
1076
1076
	BLI_argsAdd(ba, 1, "-v", "--version", "\n\tPrint Blender version and exit", print_version, NULL);
1077
	BLI_argsAdd(ba, 1, "-v", "--version", "\n\tPrint Blender version and exit", print_version, NULL);
1077
1078
1078
	BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution (default)", enable_python, NULL);
1079
	BLI_argsAdd(ba, 1, NULL, "-666", "\n\tEnable automatic python script execution (port from CVE-2009-3850 patch to Blender 2.49b)", enable_python, NULL);
1079
	BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)", disable_python, NULL);
1080
	BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution", enable_python, NULL);
1081
	BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes) (default)", disable_python, NULL);
1080
1082
1081
	BLI_argsAdd(ba, 1, "-b", "--background", "<file>\n\tLoad <file> in background (often used for UI-less rendering)", background_mode, NULL);
1083
	BLI_argsAdd(ba, 1, "-b", "--background", "<file>\n\tLoad <file> in background (often used for UI-less rendering)", background_mode, NULL);
1082
1084
1083
- 

Return to bug 364291