Page 1 of 2

Camera mapping (1.30)

PostPosted: Tue Feb 11, 2014 4:53 am
by roeland
This script approximately maps a texture so it fits into the camera view. Note this does not take things like distortion and depth of field into account.

Updated for versions 2.26 and 3.01:
camera map.lua
(3.9 KiB) Downloaded 308 times


Additional features:
  • the script also works for orthographic and spherical cameras (for cylindrical cameras it's not possible to correctly map the texture).
  • You can camera map the environment texture by selecting the texture environment node (although it will look weird if you have reflections of the environment in your scene).

Note that

--
Roeland

Re: Camera mapping (1.30)

PostPosted: Mon Feb 17, 2014 1:01 pm
by r-username
love this script

Is there any way to repeat the script on a folder of png files so we can have camera/projection mapped animation? I think I can do this in the blender plugin but checking if there is an easy way to do this in the standalone.

cheers,
S

Re: Camera mapping (1.30)

PostPosted: Wed Jan 14, 2015 8:12 am
by jitendra
roeland wrote:Since we changed the texture projections for version 1.30 I updated this script. The UV transform doesn't need the (.5, .5) offset anymore, and the width given for the scale is the full width, not the half width.

camera map 1.30.lua


Additional features:
  • the script also works for orthographic and spherical cameras (for cylindrical cameras it's not possible to correctly map the texture).
  • You can camera map the environment texture by selecting the texture environment node (although it will look weird if you have reflections of the environment in your scene).

--
Roeland


Thank you Roeland,
Works like a charm.
Best Regards, JITENDRA

Re: Camera mapping (1.30)

PostPosted: Tue May 31, 2016 10:07 pm
by leehenshall
Great script! I can't seem to get it working with Octane 3.0. Can someone modify the script to make it compatible?

Re: Camera mapping (1.30)

PostPosted: Thu Jun 02, 2016 10:13 pm
by roeland
The change to the resolution node in the render target broke quite some scripts.

When you get a complaint about a missing pin called octane.P_RESOLUTION, you can change:

Code: Select all
local resolution = rendertarget:getPinValue(octane.P_RESOLUTION)


to:

Code: Select all
local resolution = rendertarget:getInputNode(octane.P_FILM_SETTINGS):getPinValue(octane.P_RESOLUTION)


--
Roeland

Re: Camera mapping (1.30)

PostPosted: Fri Jun 03, 2016 12:04 am
by calus
Thanks for the update an the Tip :)

Re: Camera mapping (1.30)

PostPosted: Sat Jun 04, 2016 12:49 pm
by leehenshall
Thanks roeland.

I did a find and replace using notepad++ then restarted Octane and attempted to run the script with the image texture selected and still getting an error in Octane 3.

See attached image:

Re: Camera mapping (1.30)

PostPosted: Sat Jun 04, 2016 12:59 pm
by leehenshall
Opps! sorry my mistake the fix does work. I just didn't have my render target selected/activated.

Thanks for the quick turn around roeland :)

Re: Camera mapping (1.30)

PostPosted: Wed Jul 13, 2016 5:28 pm
by manalokos
The script is broken on V3.0, it cannot access P_RESOLUTION, and I don't know the syntax to fix it.
Can anyone help?

Thanks
Kind regards
Filipe

Re: Camera mapping (1.30)

PostPosted: Thu Jul 14, 2016 11:05 am
by bepeg4d
Hi Filipe,
could you try with this version?
camera_map_v3.lua
(3.97 KiB) Downloaded 358 times

ciao beppe