Swap low resolution mesh for high resolution at render. #31625
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#31625
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Project: Blender Extensions
Tracker: Py Scripts Upload
Blender: 2.63
Category: Render
Python: 3.1
Script name: render_swap_lod.py
Author(s): Aaron Symons
Status: Open
%%%Features:
Setup:
The file should go into: scripts/addons/
Enable the addon by going to: User Preferences > Render > Swap L.O.D.
In order for it to work, you must adhere to a naming convention, example:
Low-resolution object:
Corresponding High-resolution object:
Manual:
Once everything is set, check the ‘Enable Swap’ checkbox to enable the swap. When you render the scene, all low-resolution objects will have the high-resolution mesh data, and will revert back to their low-resolution state after rendering.
Checking ‘Enable Swap’ also allows you to swap resolutions within the viewport, using the buttons that become active – useful for checking composition before rendering.
To use your own naming convention, check ‘Use Custom’ to display the text fields where you give the naming convention you’re using. Please note: what is typed in the 'Use Custom' text fields is for the script only; this will not change any object names or mesh data names.
%%%
Changed status to: 'Open'
%%%Wiki page: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Swap_LOD
Sorry, I'm not sure how to edit the info.%%%
%%%Latest file is: render_swap_lod-1.zip
This one has the links to Wiki and Tracker pages in the bl_info, whereas the other one does not.
Again, oopsy!%%%
%%%UPDATE:
New version (v0.1.1) - http://projects.blender.org/tracker/download.php/153/467/31625/20878/render_swap_lod-2.zip
Changes (UI):
%%%I've been making a silly mistake- renaming the zipped folder AFTER zipping!
This is the current version (v0.1.1): render_swap_lod-2-update.zip
Thanks, and sorry for my stupidity! :)%%%
%%%One very important thing I haven't mentioned is that the high-res version must be on a different scene layer to the low-res!
So, for example;
low-res = layer 1
high-res = layer 2
Very sorry to anyone who has tried to use it so far and it's failed!%%%
%%%UPDATE:
New version (v0.1.2) - render_swap_lod-3.zip
Changes (CODE):
%%%UPDATE (CODE, UI, IMPLEMENTATION):
A near complete re-write of the addon.
As of: v0.1.3
Wiki (with screen-shots): http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Swap_LOD
Naming convention of file upload now includes version number: render_swap_lod-v0-1-3.zip
During render, the low-resolution object's mesh data is swapped with a defined high-resolution mesh data.
To use it, simply select the low-resolution object and go to it's Object Data tab (Properties Window -> Object). At the bottom you should see three properties under the 'Custom Properties' panel, named: "swapRes_enable", "swapRes_high", and "swapRes_low". If these do not show, either collapse and expand the 'Custom Properties' panel, or click "Update" (Tools (T) -> Swap L.O.D. -> Update).
Once everything is set, check the "Enable Swap" checkbox (Tools (T) -> Swap L.O.D. -> Enable Swap) to enable the swap during render. When you render the scene, all enabled low-resolution objects will have the high-resolution mesh data, and will revert back to their low-resolution state after rendering. Checking "Enable Swap" also allows you to swap resolutions within the viewport, using the buttons that become active when checking this option – useful for checking composition before rendering.
Happy swapping!
Big thanks to Jason van Gumster (Fweeb) for his ideas and contributions to helping me make this a very flexible addon!%%%
%%%hi & welcome :)%%%
%%%Hello there! :)
Sorry for all my posts yesterday. I like things clean and organised, but I was just too excited to get my first addon available that my mind escaped me a few times! Plus, as soon as I was uploading I found little improvements that could be made. :P
I hope my addon proves good. Any comments, or suggestions of improvements or features are welcome! :) I'm already thinking of some improvements, so you may see an update soon!%%%
%%%The updated file (render_swap_lod-v0-1-3-update.zip) contains links to Tracker and Wiki pages. Whoops! :)%%%
%%%Slight update. It seems I haven't been registering it properly:
Prepended "bpy.utils" before register and unregister module.%%%
%%%UPDATE.
I finally realised that it wasn't working properly- due to my lack of testing!
ISSUES (RESOLVED):
ADDED:
%%%UPDATE:
Some code cleaning - subtracted two unnecessary functions. Apart from that, some slight rephrasing of a couple of descriptions/tooltips for easier reading.
Current version: render_swap_lod-v0-1-3-update4.zip%%%
%%%UPDATE:
Added:
From here, the user can enable or disable objects from swapping, as well as view and change low and high-res Mesh Data used by the object (by clicking "Mesh Data")
Updated:
Happy swapping! :)%%%
%%%UPDATE:
Changed:
I re-wrote the "update_objects()" function (used by the "Update" button), and added a function to check whether an object is new or not; "is_new_object()"
This is a better system than the old one, as I found a couple of hiccups behind the scenes, which this new system seems to resolve! It's much simpler by design, allowing just one check to be done using one TRY-EXCEPT, instead of several IF-ELSE statements - which weren't 100% effective anyway, to be honest.
Slight change in UI; I added the "eye" icon to the "Mesh Data" button, and I'm also using the 'RESTRICT_VIEW' versions, as opposed to the "VISIBLE_IPO" ones I was previously using. ;)
I also noticed a couple of errors in the code, where I seemed to be assigning values where I wanted to check them, example; I had: obj.swapRes_high instead of obj['swapRes_high']
I haven't spotted anything else. So far, so good! :)%%%
%%%I forgot to mention another good change!
The values of the properties are never lost now, for example; Object1 has:
swapRes_enable = True
swapRes_high = "a high resolution version"
etc....
Whe closing and re-opening the .blend file, those values will still be there.
This is a result of the re-written update system - nothing is ever lost! So, if you have twenty objects set how you want, you can be safe in the knowledge that those values will still be there the next time you open the .blend file. :)%%%
%%%UPDATE:
Added:
A "Never Swap" option. This is mainly so objects that will never be involved in high/low-res swapping won't be listed when showing disabled (keeping it to just those we need to see).
This would be for things like floors, walls, and anything else that doesn't need to be listed here.
A "Show All" button, which lists every object in the scene, excluding lights and cameras
Apart from that, some more code cleaning.
I thnk it's reached the stage where I need some user feedback now, and getting it tested in real-world scenarios and big scenes. So, there probably won't be an update for a little while. That is, unless I think of some useful additions and/or changes. :)%%%
%%%Also! :)
If the user tries to swap resolutions and the mesh data name cannot be found, a error message will appear above the UI and details of the error to the Console (name of the mesh data that counldn't be found and the object it was supposed to be assigned to). This is just incase the user changes a mesh data name, for some reason, and forgets to update the fields in the addon - you never know, don't want to keep them wondering! ;)%%%
%%%Aaron,
that sounds quite promising.
I was thinking about if flipping the default behaviour of the "Never Swap" option was perhaps better? As there perhaps are many more objects which you don't want to swap. But then i realized that this is not really the case ... rather the other way round.
And it's a list anyway ... i'm sure i will test this after my current aerospace project (when plan to follow one of the genious tutorials of the legendary cgcookie David Ward).
Many good artists around here ... and developers of course which make this possible. Quite impressed.%%%
%%%Hi Jon,
The "Never Swap" option just prevents that object from showing in the UI list to keep things concise for the user.
David Ward actually inspired me to write this addon when watching one of his tutorials on his YouTube channel. He used low poly place-holders for his high poly models so he could get an idea of the composition, then swapped the mesh data of the place-holders with the high poly models when rendering. I thought this should be an easier process, so I wrote this little addon. :)
I'll be looking at this addon again and might be rewriting it, as I think it could do with another look. Plus, I have a couple of ideas for updates.
Thanks for your interest, and I hope you find it useful!%%%
The new developer system is brilliant. Didn't notice this post before. Thanks for clarifying!
What a coincidence with David Ward. I remember the tutorial you mentioned. :)
Clearly very useful your addon! And even better and more useful now that I have to dig deeper into BGEngine too. Keep it up masters! (have to tidy up my addons too .. probably for 2.7)
hi,
This addon is currently Broken & not updated.
As part of maintenance & clean up of older addon pages I'm closing this Tracker Page for now.
Please feel free to re-submit an updated version & we can re-open the page.
Thanks.
Brendon.
Changed status from 'Open' to: 'Archived'