[Closed] Mirror Multiple Target Cameras Locally
Hello!
I’m using a script generously provided to me by denisT to get cameras to be created at the locations of various heads in my scene. ( http://forums.cgsociety.org/showthread.php?p=7605122 )
I’m noticing a problem though using geometry created in SketchUp/AutoCAD, probably related to the XYZ differences between the programs: since the rooms I generally build are symmetrical, I’ll often populate half the room with people and then mirror them, but I’m noticing in 3ds Max running the camera script creates target cameras on the mirrored geometry facing the wrong way! Very strange. Since I can’t think of a way to fix this in the first place, I’m trying to put together a simple script to correct this after the fact, which requires mirroring the camera locally on it’s Z axis, and then it’s XY.
also, for some reason rotating the cameras at all seems to fix it… super strange.
” for o in selection do o.transform = (rotateZmatrix 5) * o.transform “
thanks!
attach a scene with two heads… one is which works correct and another is which causes flipped camera placement.
it might help.
also, I use the attached script to combine cameras all into the timeline so I can batch render out a large number of views at once. For some reason, this seems to reset the cameras to their ‘original’ state… maybe because they are all still linked to the individual heads and their coordinate systems?
ok. i just tweaked the scripts a little… it has to work well for any head now:
try(destroydialog SpectatorCameraDialog) catch()
rollout SpectatorCameraDialog "Spectator Camera" width:200
(
local cameraname = "Spectator_Camera"
edittext cameraname_tx "Name:" text:cameraname fieldwidth:150 align:#right offset:[9,0]
button createcam_bt "Create Cameras" width:192 align:#right offset:[9,4]
on cameraname_tx changed text do cameraname = text
on createcam_bt pressed do undo "Create Cameras" on
(
cams = for node in selection collect
(
name = node.name + "_" + cameraname
tm = (transmatrix [0, units.decodevalue "9'", units.decodevalue "-5'"])*node.transform
c = TargetCamera name:name target:(TargetObject name:(name + ".Target")) pos:tm.pos parent:node
)
select cams
)
)
createdialog SpectatorCameraDialog