This is my first python script for blender 2.80:
Blender 2_80_Proxy Tools.py (11.8 KB)
The script creates ‘vray proxy’ like vertex cloud representations of highpoly objects as I think that is a feature which is missing in blender especially when it comes to foliage in architectural visualistion or landscape scenes. (Some inspiration was taken from Manuel Geissinger’s BlenderProxy Addon)
To do that it makes use of collection instances and offloading the original highpoly objects in a separate library file, if desired.
I tested the script with tree models with 1mio+ polygons. In particle systems with up to 10.000 instances my viewport is still responding very well, compared to the solid display of the same models. To a certain point the vertex cloud representation is more accurate then bounding box. With high numbers of instances the view gets very crowded, however, masses are still readable in my opinion.
So far I kept the panel quite simple:
- Reduce Vertices determines the amount of vertices that will be deleted when creating the vertex cloud and accordingly its density
- Offload Geometry will create a separate proxy_library.blend file to store the highpoly object if checked, if not, all objects and collections that are created by the script will be unlinked from the scene but still remain in the current .blend file
- Create Proxy will create a vertex cloud representation of the active object
I am uploading it to get suggestions on how to fix some errors like the pre and post render buttons/ operators as they do not work as I want them to.
Their purpose is to prepare the scene for preview render by changing the viewport visibilities and display types of the proxy objects. That way it is possible to render the highpoly objects in preview. (For final renders it is not necessary to press these buttons)
The error occurs after creating the vertex cloud proxy. I guess it’s because the operators are meant to effect certain objects in the scene but exactly these objects are removed while the script is running. The result is that the display type of the objects is not changed correctly.
I don’t know if there is another way to change the object’s display type apart from
bpy.context.scene.objects.display_type or if I am just using the wrong arguments for the operators. I am open for tips and suggestions on how to correct that.
Moreover, I would be glad if some of you are willing to test the script and report any bugs or inconviences that need to be fixed. Also, if you have tips to improve the script’s performance or anything else I would be happy to know.
As this is my first script I want to apoligize in advance for any style mistakes in the code. It is still work in progress and far from being perfect. Help is always welcome.
All that being said, I hope you like it and that it supports you in your workflow.