Texture blend in 1.2x?

A forum where development builds are posted for testing by the community.
Forum rules
NOTE: The software in this forum is not %100 reliable, they are development builds and are meant for testing by experienced octane users. If you are a new octane user, we recommend to use the current stable release from the 'Commercial Product News & Releases' forum.
Post Reply
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Is it possible to do a linear texture blend during an animation?
For example, I have a morph target, so object A morphs into object B.
I tried the animation and it works fine with alembic, but how can I blend the textures from A to B?
Do I need a Lua script?
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Yep, that should be possible. It's possible to script this in the standalone but I guess if your plugin supports it, it's easier that way.

cheers,
Thomas
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

stratified wrote:Yep, that should be possible. It's possible to script this in the standalone but I guess if your plugin supports it, it's easier that way.

cheers,
Thomas
My Company only purchased the standalone version, so can you please tell me how to do this? I'm gonna need it very soon for a project I'm working on, and if I cannot do texture blend in Octane I will be forced to use VRay, and I don't really want to... :(
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Hi Rikk,

I don't have time to create a full blown production stable script. But I can give some pointers on how you can tackle this.

First, we need to set up the "animator" on the RGB texture node you want to animate. All this animator does is make sure that for each time frame the RGB texture gets the right colour. This simple script sets up an animator on the RGB texture node you selected. In this script, we blend from pure red to pure green.

Code: Select all

-- Texture colour blending animation. This will hook up colour blending
-- on the selected texture node.
--
-- @description Hooks up a texture with a colour blend animation.
-- @author      Thomas Loockx
-- @version     0.1

-- hooks up an animator with the texture
local function setTexAnimator(tex, startColour, endColour, nbFrames)
    -- animator will interpolate between these colours
    tex:setAnimator(octane.A_VALUE, { 0 }, { startColour, endColour}, 1)
end


-- Get the selected RGB texture node
local tex = octane.project.getSelection()[1]
assert(tex:getProperties().type == octane.NT_TEX_RGB, "RGB texture node expected")

-- hook up the animator for colour blending RED -> GREEN
setTexAnimator(tex, { 1, 0, 0 }, { 0, 1, 0}, 25)
When the script is finished, the timeline should appear in your project. When you scrub it, the colour of the RGB texture node should change from red to green.

Now that the animation is set up, you need a script to render out the animation. Roeland has created an excellent script for this: http://render.otoy.com/forum/viewtopic.php?f=73&t=37387. So what you need to node now is run this script while the correct render target is selected. It shows a UI to tweak some settings. If all went fine, you should have rendered an animation with colour blending.

This is a cube rendered on my PC:

[youtube]http://www.youtube.com/watch?v=Dn2Q3E6odHo&feature=youtu.be[/youtube]

Hope this helps.

cheers,
Thomas
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Wow, thank you for the reply! I only wish I understand what you wrote in the script... :?
I need to blend albedo map, normal map, specular map, and glossiness map, from time A to time B.
Is that possible with the script above?
User avatar
bepeg4d
Octane Guru
Posts: 10328
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi rikk, great request, now we are able to make material blanding easily ;)
first of all, a big thanks to thomas for the script :) i have changed the color blanding from white to black so what is needed is only to assign an rgb node to an amount port of a mix texture or mix material node. select the rgb node and run the script and voilà... blanding materials in standalone :D
lua rocks :D
ciao beppe
bland-bw.lua
(825 Bytes) Downloaded 187 times
bland-material.rar
(2.53 KiB) Downloaded 177 times
Capture-st124-07.JPG
Capture-st124-08.JPG
Capture-st124-09.JPG
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Nice work, bepe! 1.25 will have colour swatches, I'will modify the script later to show an example with colour swatches.

@Rikk, does this solve your problem? The scripting is mainly for creating trivial animations. Octane isn't going to have any animation tools fairly soon, it's just a render engine. Unless some user writes some full animation tool suite in lua but I expect that someone who goes through that effort will not give away this thing for free.

I still highly recommend looking into using host apps for creating animations and rendering the animation with an integrated plugin. It's going to save you a lot of time and headaches for complex animations.

cheers,
Thomas
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

I've posted a more complete example for 1.25 here: http://render.otoy.com/forum/viewtopic.php?f=73&t=37672
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

stratified wrote:@Rikk, does this solve your problem? The scripting is mainly for creating trivial animations. Octane isn't going to have any animation tools fairly soon, it's just a render engine. Unless some user writes some full animation tool suite in lua but I expect that someone who goes through that effort will not give away this thing for free.
If I understand correctly, what your script does is changing the RGB value, which is neat, but I need to blend RGB TEXTURES, not just colors. And as I said before, I need the blend to happen in albedo, normal, specular and glossy texture slots.
Beppe can you help me out? I really need this function, or I will have to use a different software.
User avatar
roeland
OctaneRender Team
Posts: 1823
Joined: Wed Mar 09, 2011 10:09 pm

You can use a mix texture with the two image maps for every texture, or you can use a mix material and two materials.

Then you can select the Amount input node of the mix texture or mix material (use the outliner if this is not a separate node in the graph editor) and run this script:

Code: Select all

-- Time span to animate:
totaltime = 2

-- Get the selected float texture node
local tex = octane.project.getSelection()[1]
assert(tex:getProperties().type == octane.NT_TEX_FLOAT, "float texture node expected")

-- hook up the animator for going from 0 to 1
tex:setAnimator(octane.A_VALUE, { 0 }, { 0, 1 }, totaltime)
octane.changemanager.update()
If the duration is wrong, change it in the second line of the script.

--
Roeland
Post Reply

Return to “Development Build Releases”