octane_render_utils_lua

Forums: octane_render_utils_lua
Forum for OctaneRender Lua scripting examples, discussion and support.

octane_render_utils_lua

Postby rrbarb » Mon Jul 11, 2022 7:05 pm

rrbarb Mon Jul 11, 2022 7:05 pm
This script is called a require in batch render script- And in working with AWS Deadline- They claim it ships with Octane.
I find no trace of this in any installed folders- Where is it?- Where can I get a copy of it?

./rrb
rrbarb
Licensed Customer
Licensed Customer
 
Posts: 88
Joined: Wed Feb 26, 2014 1:40 am

Re: octane_render_utils_lua

Postby bepeg4d » Tue Jul 12, 2022 6:30 am

bepeg4d Tue Jul 12, 2022 6:30 am
Hi,
it should be shared by Thinkbox Deadline directly, not by us.

Anyway, please try with the following LUA script for AWS Thinkbox:
download/file.php?id=85243

ciao,
Beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: octane_render_utils_lua

Postby rrbarb » Tue Jul 12, 2022 10:55 am

rrbarb Tue Jul 12, 2022 10:55 am
bepeg4d wrote:Hi,
it should be shared by Thinkbox Deadline directly, not by us.

Anyway, please try with the following LUA script for AWS Thinkbox:
download/file.php?id=85243

ciao,
Beppe


Thank You for the response. AWS does supply a version of the cmdbatch as you have shared here.
What I am after is what is being called on line 26: require("octane_render_utils_lua")
octane_render_utils
./rrb
rrbarb
Licensed Customer
Licensed Customer
 
Posts: 88
Joined: Wed Feb 26, 2014 1:40 am

Re: octane_render_utils_lua

Postby jobigoud » Tue Jul 12, 2022 2:49 pm

jobigoud Tue Jul 12, 2022 2:49 pm
I find no trace of this in any installed folders- Where is it?


It is inside the engine and loaded by it. It's not a separate file.
Do you have a particular error?
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: octane_render_utils_lua

Postby rrbarb » Tue Jul 12, 2022 3:12 pm

rrbarb Tue Jul 12, 2022 3:12 pm
jobigoud wrote:
I find no trace of this in any installed folders- Where is it?


It is inside the engine and loaded by it. It's not a separate file.
Do you have a particular error?


2022-07-12 11:08:39: 0: STDOUT: Started logging on 12.07.22 11:08:34
2022-07-12 11:08:39: 0: STDOUT: OctaneRender Enterprise 2021.1.5 (11000500)
2022-07-12 11:08:39: 0: STDOUT: [string "octane_render_utils_lua"]:200: bad argument #3 to 'gsub' (string/function/table expected) (line: 200)
2022-07-12 11:08:39: 0: STDOUT: Stopped logging on 12.07.22 11:08:39

This is from deadline log- the selected output format is exr- all passes- single file - I can't solve if I cant see line 200 or whatever it may be- has to be a way to print or dump these utils

I have found a solve for this. From the research entailed in the quest, and from the @jobigoud clue- octaneRenderUtil must be a compiled C script- I can see part of through lua- but not line by line. The solve was to change the functions that handle fileFormat/imageSaveFormat and exrCompression type to use their index number as in API.
rrbarb
Licensed Customer
Licensed Customer
 
Posts: 88
Joined: Wed Feb 26, 2014 1:40 am

Re: octane_render_utils_lua

Postby rrbarb » Wed Jul 13, 2022 2:59 pm

rrbarb Wed Jul 13, 2022 2:59 pm
rrbarb wrote:
jobigoud wrote:
I find no trace of this in any installed folders- Where is it?


I can't solve if I cant see line 200 or whatever it may be- has to be a way to print or dump these utils



I have found a solve for this. From the research entailed in the quest, and from the @jobigoud clue- octaneRenderUtil must be a compiled C script- I can see part of through lua- but not line by line. The solve was to change the functions that handle fileFormat/imageSaveFormat and exrCompression type to use their index number as in API. This is working- but the cause is not clear to me.

IT would be very helpful to have a digest of the expected content that ocataneRenderUtils expects to be present.
rrbarb
Licensed Customer
Licensed Customer
 
Posts: 88
Joined: Wed Feb 26, 2014 1:40 am

Re: octane_render_utils_lua

Postby abstrax » Thu Jul 14, 2022 12:14 am

abstrax Thu Jul 14, 2022 12:14 am
`octane_render_utils_lua` contains internal helper functions shared between various render scripts / jobs. We are not making those public as we can't/don't want to guarantee that the interface won't change in the future. If we would make it public, then we would not be able to update/modify it easily since otherwise existing user projects might get screwed.

The function you are having trouble with is octaneRenderUtils.createFilename():
Code: Select all
-- Creates a filename based on a passed in filename template.
--
-- @param[in] template
--  Filename template with embedded %? chars which are substituted by something else.
-- @param[in] renderTargetIx
--  Index of the render target.
-- @param[in] frameIx
--  Frame index.
-- @param[in] subFrameIx
--  Sub-frame index.
-- @param[in] name
--  Name of the render target node
-- @param[in] imageSaveFormat
--  Type of the output image (in octane.imageSaveFormat)
-- @param[in] pass
--  Name of the current render pass.
function octaneRenderUtils.createFilename(template, renderTargetIx, frameIx, subFrameIx, name,
        imageSaveFormat, pass)
    assert(template, "expected template")
    assert(renderTargetIx, "expected renderTargetIx")
    assert(frameIx, "expected frameIx")
    assert(subFrameIx, "expected subFrameIx")
    assert(name, "expected name")
    assert(imageSaveFormat, "expected imageSaveFormat")
    assert(pass, "expected pass")

    -- round to integer value incase frameix has a float value
    frameIx = math.floor(frameIx + 0.5)
   
    -- common extension for our image output types
    local fileExtensions =
    {
        [octane.imageSaveFormat.PNG_8 ] = "png",
        [octane.imageSaveFormat.PNG_16] = "png",
        [octane.imageSaveFormat.EXR_16] = "exr",
        [octane.imageSaveFormat.EXR_32] = "exr",
    }
    local s = template
    -- %i -> index of the render target
    s = string.gsub(s, "%%i", string.format("%d", renderTargetIx))
    -- %f or %F -> frame number prefixed with zeroes (i.e. 1 -> 001)
    s = string.gsub(s, "%%f", octaneRenderUtils.prefixWithZeroes(frameIx, 4))
    s = string.gsub(s, "%%F", octaneRenderUtils.prefixWithZeroes(frameIx, 4))
    -- %s -> sub frame number
    s = string.gsub(s, "%%s", string.format("%d", subFrameIx))
    -- %n -> name of the node
    s = string.gsub(s, "%%n", name)
    -- %e -> extension
    s = string.gsub(s, "%%e", fileExtensions[imageSaveFormat])
    -- %t -> timestamp (h_m_s)
    s = string.gsub(s, "%%t", os.date("%H_%M_%S"))
    -- %p -> render pass name
    s = string.gsub(s, "%%p", pass)
    return s
end


Particularly this line:
Code: Select all
    s = string.gsub(s, "%%e", fileExtensions[imageSaveFormat])


I guess you used an invalid enum value for imageSaveFormat.

EDIT: I just had a look at your script. It would have been better to just write a script from scratch using only functionality from our Lua API instead of taking an older batch render script and then ripping out all the GUI stuff and then hacking the rest to try to make it work something totally different than what it intended to do.
In theory there is no difference between theory and practice. In practice there is. - Yogi Berra
User avatar
abstrax
OctaneRender Team
OctaneRender Team
 
Posts: 5483
Joined: Tue May 18, 2010 11:01 am
Location: Auckland, New Zealand

Re: octane_render_utils_lua

Postby rrbarb » Thu Jul 14, 2022 11:12 am

rrbarb Thu Jul 14, 2022 11:12 am
abstrax wrote:EDIT: I just had a look at your script. It would have been better to just write a script from scratch using only functionality from our Lua API instead of taking an older batch render script and then ripping out all the GUI stuff and then hacking the rest to try to make it work something totally different than what it intended to do.


This is not my script. The use is same as intention- however I will take you advise and look into that. ThankYou!
./rrb
rrbarb
Licensed Customer
Licensed Customer
 
Posts: 88
Joined: Wed Feb 26, 2014 1:40 am

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 6 guests

Fri Mar 29, 2024 7:33 am [ UTC ]