1
$\begingroup$

I have a Cycles-Blender model, which I want to release to the layman users who don't know Blender and give them some freedom to manipulate and explore the model a bit (simple operations like rotating the model around or setting visibility of a certain object, etc.).

For this use, I want to build a simple GUI that "wrappers" Blender inside. For example, I can add a button that sets an object invisible in rendering.

Another important feature I need is the user being able to drag/rotate/zoom in/etc. the model, and as soon as user interaction is done, the render starts progressively. It's the same thing when you are in Object Mode with Rendered as Viewport Shading.

Is there an easy/clean way of doing this?

I am a CS student and know how to code in Blender-Python. So if there isn't a clean way, please also teach me the dirty way to do it. ;-)


This question isn't the same as How to create a custom UI?, which wants to customize around the Blender GUI. Instead, I want to build from scratch, as the layman users really need super simple GUI's.


$\endgroup$
4
  • $\begingroup$ have you considered a web based front end? sketchfab.com/tags/blender does a remarkable job depending on the end users machine and the scene complexity. $\endgroup$
    – rob
    Commented Mar 14, 2017 at 8:54
  • $\begingroup$ @rob Actually web based front end is even better! Wow, this looks very promising! Do you know how I can build a similar front end? I may need more functionality than what sketchfab already has. $\endgroup$ Commented Mar 14, 2017 at 12:55
  • $\begingroup$ I do not can you not directly use the sketchfab embed option? otherwise I would suggest opening a dialog with them as they may have skin-able version though a fee maybe required. $\endgroup$
    – rob
    Commented Mar 14, 2017 at 13:35
  • $\begingroup$ sketchfab is an excellent suggestion that I chose to follow. Thanks @rob! $\endgroup$ Commented Mar 18, 2017 at 20:10

1 Answer 1

2
$\begingroup$

Sounds like you're trying to re-invent the wheel.

I'd imagine you might use Python for your GUI
to remain consistent with Blender scripting.

I'd look into PySide.
It's an open-source Python wrapper for the Qt lib.

PySide can access OpenGL via PySide.QtOpenGL calls,
so you'd have a way to view your model that way.

Then you'd most likely use a subprocess call to Blender
on the commandline for your final render.

If you need to access bpy and all those features,
you could compile Blender as it's own Python module:
https://wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule

You might look into the Blender 101 Project first.
https://code.blender.org/2016/12/the-blender-101-project-and-you

It might do what you're trying to accomplish.

Contributing to that might be an easier way
for everyone to enjoy using Blender, even beginners.

$\endgroup$
3
  • $\begingroup$ Many thanks for the pointers! This sounds great for all but one feature: as soon as the mode manipulation/zoom-in/etc. is done, it should start rendering progressively. It seems that worst case scenario would be to repeatedly call Blender's render process and update the display. Not sure if that's a good idea? $\endgroup$ Commented Mar 14, 2017 at 13:45
  • $\begingroup$ Progressive render from the commandline? That's a tough one. You can have pre-generated scripts that the user fills in values, by way of your GUI. Then just run those to set render options. blender.stackexchange.com/questions/3061/… - but I can't imagine you'd see the display update 'till it's complete. Maybe by compiling Blender as a module it would give you access to the render buffer? I'd imagine it's in bpy.data somewhere. Then update gui after each pass. You might have to look into the source code to figure that one out though. $\endgroup$ Commented Mar 14, 2017 at 17:28
  • $\begingroup$ I believe the proper path would be: bpy.data.node_groups["Compositing Nodetree"].nodes["Render Layers"].layer[0] as your Image, with .layer[1] as Alpha, and .layer[3] as Z $\endgroup$ Commented Mar 14, 2017 at 21:18

You must log in to answer this question.

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