9
$\begingroup$

I'm writing a Python script that creates a Blender scene; I'm running it from the command line with blender -P script.py. However, the splash screen always appears and it's really annoying. Is there something I can do from the script that prevents the splash screen from showing up for just that invocation of Blender? Note that I do not want to change the global preference.

The tooltip over the user preferences splash screen setting recommends bpy.types.UserPreferencesView.show_splash, but changing this from my script doesn't seem to do anything.

$\endgroup$
2
  • $\begingroup$ Is there a reason why you invoke your script via command line in window-mode? You would typically run a script via a button in the UI if you work in Blender, or run a script via command line with blender in background mode (no window, usually for rendering). $\endgroup$
    – CodeManX
    Dec 2, 2013 at 16:29
  • $\begingroup$ I'm not working in Blender. I'm just using it to look at the results of another tool. $\endgroup$ Dec 2, 2013 at 18:10

2 Answers 2

9
$\begingroup$

The attribute to change is not in UserPreferencesView type, but in that class' instance. The right instance to modify, currently used viewing data preferences, is the view attribute of bpy.context.user_preferences:

import bpy

bpy.context.user_preferences.view.show_splash = False
$\endgroup$
1
  • 1
    $\begingroup$ 2.8: bpy.context.preferences.view.show_splash = False $\endgroup$ Jun 5, 2022 at 22:58
3
$\begingroup$

The previous answer was correct before, but now the interface has changed.

After Blender 2.80

import bpy

bpy.context.preferences.view.show_splash = False

Before Blender 2.80

import bpy

bpy.context.user_preferences.view.show_splash = False
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .