ScriptSpot

Forum topic · Scripts Wanted

hi there i need a little help with my camera script

By poly83 · 2007-07-11

Description

Hi there,

i guess you pros will solve this in a second.

i want a button that creates a camera when i click on it. it should be a free camera with specified position and rotation. i just cant get it...

why does this not work?

button btn22 "create 50° camera" pos:[8,384] width:126 height:24

on btn22 pressed do

Freecamera transform:(matrix3 [1,0,0] [0,0,0] [0,-1,0] [29.8893,1.32263e-006,-30.2583]) name:"camera50" isSelected:on

select $camera50 rotate angleaxis 50 [1,0,0]

it seems there is a syntax problem... but when i apply the same code to 2 different buttons, it works.

like -->

button btn22 "create camera" pos:[8,384] width:126 height:24

on btn22 pressed do

Freecamera transform:(matrix3 [1,0,0] [0,0,0] [0,-1,0] [29.8893,1.32263e-006,-30.2583]) name:"camera50" isSelected:on

button btn23 "50° rotate camera" pos:[8,384] width:126 height:24

on btn23 pressed do

select $camera50 rotate angleaxis 50 [1,0,0]

what am i doing wrong??

i hope you can understand the problem.

thanks very much in advance!!

cheers.

Comments (1)

poly83 · 2007-07-11

okay problem solved with:

button btn22 "create 50° camera" pos:[8,384] width:126 height:24

on btn22 pressed do
(
freecamera name:"cam_50degrees"
move $cam_50degrees [0,-110,200]
rotate $cam_50degrees (angleaxis 30 [1,0,0])
select $cam_50degrees
viewport.setType #view_camera
)

it was a bracket count problem :D

now i got another problem with the rendersettings... :I
i tried to make a script what does the following:

click on the button > set renderdimensions to 64x64 pixels an save the rendering to a specified file... actually no problem with:

button btn23 "Set Rendersettings" pos:[8,448] width:126 height:24

on btn23 pressed do
(

rendering=bitmap 64 64 filename:"C:\\***\\*.tga"
(
render camera:$cam_50degrees outputwidth: 64 outputheight: 64 camera:cam_50degrees to:rendering
save rendering
)

but i want the alpha channel of that rendering saved as 24bit tga (not 32bit) as tga!

any suggestions?

thanks in advance!