Camera mapping (1.30)

Forums: Camera mapping (1.30)
Forum for OctaneRender Lua scripting examples, discussion and support.

Camera mapping (1.30)

Postby roeland » Tue Feb 11, 2014 4:53 am

roeland Tue Feb 11, 2014 4:53 am
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 625 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
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1808
Joined: Wed Mar 09, 2011 10:09 pm

Re: Camera mapping (1.30)

Postby r-username » Mon Feb 17, 2014 1:01 pm

r-username Mon Feb 17, 2014 1:01 pm
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
i7 960 - W7x64 - 12 GB - 2x GTX 780ti
http://www.startsimple.com/ - http://www.gigavr.com/
r-username
Licensed Customer
Licensed Customer
 
Posts: 217
Joined: Thu Nov 24, 2011 3:39 pm

Re: Camera mapping (1.30)

Postby jitendra » Wed Jan 14, 2015 8:12 am

jitendra Wed Jan 14, 2015 8:12 am
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
Best Regards, Jitendra
jitendra
Licensed Customer
Licensed Customer
 
Posts: 140
Joined: Sat Oct 16, 2010 6:09 am

Re: Camera mapping (1.30)

Postby leehenshall » Tue May 31, 2016 10:07 pm

leehenshall Tue May 31, 2016 10:07 pm
Great script! I can't seem to get it working with Octane 3.0. Can someone modify the script to make it compatible?
leehenshall
Licensed Customer
Licensed Customer
 
Posts: 183
Joined: Sun Oct 25, 2015 5:44 pm
Location: England

Re: Camera mapping (1.30)

Postby roeland » Thu Jun 02, 2016 10:13 pm

roeland Thu Jun 02, 2016 10:13 pm
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
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1808
Joined: Wed Mar 09, 2011 10:09 pm

Re: Camera mapping (1.30)

Postby calus » Fri Jun 03, 2016 12:04 am

calus Fri Jun 03, 2016 12:04 am
Thanks for the update an the Tip :)
Pascal ANDRE
calus
Licensed Customer
Licensed Customer
 
Posts: 1308
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Re: Camera mapping (1.30)

Postby leehenshall » Sat Jun 04, 2016 12:49 pm

leehenshall Sat Jun 04, 2016 12:49 pm
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:
Attachments
scipt_error.JPG
leehenshall
Licensed Customer
Licensed Customer
 
Posts: 183
Joined: Sun Oct 25, 2015 5:44 pm
Location: England

Re: Camera mapping (1.30)

Postby leehenshall » Sat Jun 04, 2016 12:59 pm

leehenshall Sat Jun 04, 2016 12:59 pm
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 :)
leehenshall
Licensed Customer
Licensed Customer
 
Posts: 183
Joined: Sun Oct 25, 2015 5:44 pm
Location: England

Re: Camera mapping (1.30)

Postby manalokos » Wed Jul 13, 2016 5:28 pm

manalokos Wed Jul 13, 2016 5:28 pm
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
manalokos
Licensed Customer
Licensed Customer
 
Posts: 438
Joined: Fri Nov 18, 2011 4:43 pm

Re: Camera mapping (1.30)

Postby bepeg4d » Thu Jul 14, 2016 11:05 am

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

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

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 5 guests

Thu Mar 28, 2024 12:32 pm [ UTC ]