Please may we ask a moment of your time?

Your opinion counts. Many people's opinions count higher.
Less than a minute of your time is all we ask of you (yes this has actually been timed).
Please fill out our pre-Siggraph Fusion poll.

:cheer: Thank you everyone for being a great community member! :cheer:

Click here to go to the poll.

Any alternative to hos_SplitEXR?

User avatar
Midgardsormr
Fusionista
Posts: 651
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 51 times
Contact:

Re: Any alternative to hos_SplitEXR?

#31

Post by Midgardsormr » Mon Oct 09, 2017 1:42 pm

Should it be file:io.close() instead of just file:close()?

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 91 times
Contact:

Re: Any alternative to hos_SplitEXR?

#32

Post by AndrewHazelden » Mon Oct 09, 2017 2:06 pm

Midgardsormr wrote:Should it be file:io.close() instead of just file:close()?
Hi Midgardsormr.

I'm thinking of just implementing a far simpler fusion:SetData() and fusion:GetData() mode for saving the AskUser output. Retiring the old preference file technique would remove a lot of headaches for everyone and improve the reliability.

User avatar
Midgardsormr
Fusionista
Posts: 651
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 51 times
Contact:

Re: Any alternative to hos_SplitEXR?

#33

Post by Midgardsormr » Mon Oct 09, 2017 2:21 pm

Is data set in the fusion object like that persistent? I thought it was flushed when Fusion was closed.

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 91 times
Contact:

Re: Any alternative to hos_SplitEXR?

#34

Post by AndrewHazelden » Mon Oct 09, 2017 2:28 pm

Midgardsormr wrote:Is data set in the fusion object like that persistent? I thought it was flushed when Fusion was closed.
Yes. It is used to save persistent data. This is the easiest way to set/retrieve preferences for a Lua script in Fusion.

fusion:SetData() is global for all comps in fusion and is retained in the Fusion prefs file so it is not flushed.

comp:SetData() is specific to an individual comp in Fusion and the setting is saved inside the comp file.

Check out pages 41/42, and 74/75, 90, 122 in the Fusion 8 Script Manual.pdf file if you want to see the exact BMD description of the functions.

Cheers,
Andrew Hazelden

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 91 times
Contact:

hos_SplitEXR v1.7.2 Update

#35

Post by AndrewHazelden » Fri Oct 27, 2017 5:47 am

Hi RBemendo. :)

Here is an updated v1.7.2 unofficial version of the hos_SplitEXR script.

Download
hos_SplitEXR_fu9.lua
Fusion Support

This script has been tested and works with Fusion v7 to v9. It runs on Windows, Mac, and Linux.

Version History

v1.7.2 Unofficial Update 2017-10-27 by Andrew Hazelden <andrew@andrewhazelden.com>
Replaced the preference writing code so it uses the Fusion native fusion:SetData() and fusion:GetData() functions.
Updated the AskUser dialog.

Screenshot
2017-10-27_hos_SplitEXR_fu9_script_gui.png
You do not have the required permissions to view the files attached to this post.

RBemendo
Fusioneer
Posts: 108
Joined: Fri Dec 12, 2014 11:32 am
Been thanked: 1 time

Re: Any alternative to hos_SplitEXR?

#36

Post by RBemendo » Tue Oct 31, 2017 6:49 am

Thanks Andrew!

This is awesome. Thanks to everyone for this discussion. I have the hos_SplitEXR v1.7.2 working in Fusion 9.0.1.

The script works as expected, like the v1.7 did in Fusion 7.7.1. However when using layered EXRs from C4d, the naming convention breaks the script ( which it did in v1.7 as well. Tim Little wrote an update for the C4d naming convention that I had been using in the past and worked well in Fusion 7.7.1.

https://www.dropbox.com/s/fpcxxyrcp9f4s ... 8.lua?dl=0

Not sure if it's an easy fix to add Tim's changes into the updated script for Fusion 9, but just thought I'd mention it. Thanks again for the efforts, it works great with layered EXRs from Modo!

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 91 times
Contact:

Re: Any alternative to hos_SplitEXR?

#37

Post by AndrewHazelden » Tue Oct 31, 2017 6:57 am

RBemendo wrote:Not sure if it's an easy fix to add Tim's changes into the updated script for Fusion 9, but just thought I'd mention it. Thanks again for the efforts, it works great with layered EXRs from Modo!
Hi RBemendo.

I have downloaded the "hos_SplitEXR_TimLittle_v1_8_fu8.lua" script you linked to and am comparing it for differences. I will merge those changes in so you have the best features of all versions of hos_SplitEXR that will work in Fusion 7 - 9. :)

RBemendo
Fusioneer
Posts: 108
Joined: Fri Dec 12, 2014 11:32 am
Been thanked: 1 time

Re: Any alternative to hos_SplitEXR?

#38

Post by RBemendo » Tue Oct 31, 2017 8:40 am

Thanks Andrew,

It certainly is appreciated!

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 91 times
Contact:

hos_SplitEXR_Ultra v1.9

#39

Post by AndrewHazelden » Tue Oct 31, 2017 7:54 pm

RBemendo wrote:Not sure if it's an easy fix to add Tim's changes into the updated script for Fusion 9, but just thought I'd mention it. Thanks again for the efforts, it works great with layered EXRs from Modo!
Hi RBemendo.

Attached is a newly updated and merged "hos_SplitEXR_Ultra" version 1.9 release . :D

Download hos_SplitEXR_Ultra
hos_SplitEXR_Ultra_v1_9_fu9.lua
This script is compatible with Fusion (Free) and Fusion Studio v7-9. It runs on Windows/Mac/Linux.

Version History

v1.9 Ultra 2017-10-31 by Andrew Hazelden
  • Merged the Tim Little v1.8 revisions with my v1.7.2 revisions to make an "ultra" version that has the best parts of both scripts integrated together. The script works with Fusion (Free) and Fusion Studio v7-9.
  • Added a new "Skip Importing Alpha Channels" option that can be used when you don't want to have the alpha channels loaded by default. This is useful when loading 3D renderings with image based lighting or physical sky backgrounds that have RGB image data in the sky background zone of the scene but a transparent un-premultiplied alpha channel.
Screenshot
hos_SplitEXR_Ultra_v1_9.png
You do not have the required permissions to view the files attached to this post.

RBemendo
Fusioneer
Posts: 108
Joined: Fri Dec 12, 2014 11:32 am
Been thanked: 1 time

Re: Any alternative to hos_SplitEXR?

#40

Post by RBemendo » Wed Nov 01, 2017 2:56 pm

Cheers!

An updated version of this script with Tim Little's addition for C4d is amazing. It works perfectly!

Thank you!!

User avatar
Cedric
Posts: 40
Joined: Tue Sep 13, 2016 7:26 am
Location: Ghent
Been thanked: 6 times

Re: Any alternative to hos_SplitEXR?

#41

Post by Cedric » Wed Nov 22, 2017 4:38 pm

Hi all

Because this script was of great help with early days Fusion Cryptomatte, here is me showing some love to it.

I improved the active tool validation, how channels get parsed from a loader and how the unwanted channels get filtered out.
I also Implemented some logging functions by log level, added constants, made most of the variables local, made the script details (author, version, contributiors) print dynamically, cleaned up the header doc and release note.

If there are any issues, keep me posted.

Cheers
Cedric
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 2561
Joined: Thu Jul 31, 2014 5:31 pm
Location: Vancouver, Canada
Been thanked: 86 times
Contact:

Re: Any alternative to hos_SplitEXR?

#42

Post by SecondMan » Thu Nov 23, 2017 3:19 pm

That's a terrific update to the script - all of a sudden it turns into a learning tool in and of itself! :)

Thank you very much, Cedric!

User avatar
AndrewHazelden
Fusionator
Posts: 1001
Joined: Fri Apr 03, 2015 3:20 pm
Location: West Dover, Nova Scotia, Canada
Been thanked: 91 times
Contact:

hos_SplitEXR Ultra v1.11 - Split All Selected Nodes

#43

Post by AndrewHazelden » Fri Nov 24, 2017 8:28 am

Cedric wrote:
Wed Nov 22, 2017 4:38 pm
If there are any issues, keep me posted.
Hi Cedric.

I noticed v1.10 had an issue on my Mac when I tried to load in V-Ray and Cinema4D rendered EXR images. In my tests only the red channels came in for each of the split layers. I went over the source code and made some revisions to fix that issue.

Download v1.11.0
hos_SplitEXR_Ultra_v1.11.0.lua
Version History
Split EXR Ultra v1.11.0
  • Added a "Split All Selected Nodes" checkbox to the AskUser dialog. The "Split All Selected Nodes" checkbox allows the Split EXR Ultra script to automatically process and split apart multiple Loader nodes at the same time when you have several Loader nodes selected in the flow area.
  • Added a "Verbose Logging" checkbox to the AskUser dialog. This prints out detailed information to the Console tab about the channel splitting task.
  • Updated the C4D channel code to only be used if the regular exr channel matching process fails
  • Fixed an R/G/B channel matching logic issue
  • Fixed several variable scope issues
  • Updated the logDebug() function to only print output when a debugging state is active
  • Added a logDump() function
Edit: I noticed that flow area run "tool" scripts that have multiple node selections active show a side effect of spawning multiple AskUser dialogs. For the moment, if you want to use the new "Split All Selected Nodes" multiple selection mode in the GUI I'd suggest you run hos_SplitEXR Ultra v1.11 as a comp script installed to "Scripts:/comp/".

Download the Example EXR images + Comp

HOS-SplitEXR-Demo.zip (7MB)

Step 1. Select the three Loader nodes in the comp.

Step 2. Run the "Split EXR Ultra "script. In the AskUser dialog make sure the "Split All Selected Nodes" checkbox is enabled. When you click the "OK" button, each of the selected EXR images are split automatically into their individual channel elements.

Step 3. When each of the split apart EXR channels are viewed in the viewer window, the individual EXR based render passes is displayed as expected and you can see the results on the thumbnail icon of the node in the flow view, too.

Here is a short video clip that shows the new "Split All Selected Nodes" checkbox control at work:

You do not have the required permissions to view the files attached to this post.

User avatar
Cedric
Posts: 40
Joined: Tue Sep 13, 2016 7:26 am
Location: Ghent
Been thanked: 6 times

Re: Any alternative to hos_SplitEXR?

#44

Post by Cedric » Sat Nov 25, 2017 1:49 am

SecondMan wrote:
Thu Nov 23, 2017 3:19 pm
That's a terrific update to the script - all of a sudden it turns into a learning tool in and of itself! :)

Thank you very much, Cedric!
My pleasure Pieter! I'll just make sure next time I do such things, refrain from doing them in the middle of the night..
Andrew had to fix a few tiredness coding booboos haha.

@AndrewHazelden: Great update man! Works like a charm!

Cheers
Cedric

lozza_lozza
Posts: 2
Joined: Mon Nov 27, 2017 5:56 pm
Been thanked: 1 time

Re: hos_SplitEXR Ultra v1.11 - Split All Selected Nodes

#45

Post by lozza_lozza » Mon Nov 27, 2017 9:55 pm

Thank you so much for this, your hard work is very much appreciated!