I've found the following script from this question
area = next(area for area in bpy.context.screen.areas if area.type == 'VIEW_3D') space = next(space for space in area.spaces if space.type == 'VIEW_3D') space.viewport_shade = 'RENDERED' # set the viewport shading
I'm looking to use it in a Blend file that I have designed for colleagues of mine who are not proficient in 3d to load up and render a logo design that they have saved as a texture.
Currently I've got a panel with a bunch of colour options for them to adjust set in the Tool Shelf of the 3D window, there's also a nice big Render button.
The above code is now set into that script and means that when my colleagues open the file it automatically starts Cycles so that they can see the design, see below:
However I want it to default to Material, to avoid any problems with GPU crashes, and then have a couple of buttons in the panel to jump between the 2 options.
I'm guessing it's going to require some if statements but I've never done this in Python before, I'm a PHP programmer normally so understand the concept.
Any help would be gratefully appreciated.