mcjExportCameraToPZ3
DS 1,2,3,4
mcjExportCameraToPZ3 is a script for Daz Studio 1, 2, 3 and 4
it lets you export an animated Daz Studio camera ( including animated focal length ) as a PZ3 ( poser scene file )
which can then be used in Carrara or Poser
the main intended use is to bring Voodoo/VooCat camera tracking animations to Carrara and Poser
another Daz Studio script found on this site, named mcjVooDooDaz lets you import camera tracking data produced
by Voodoo/Voocat into Daz Studio
Here's a quick rundown of the steps
1 - shoot a short ( ideally under 8 seconds ) video
2 - using a video editor ( virtualDub for example ) convert the video into a sequence of numbered images
3 - perform camera tracking in Voodoo or Voocat
4 - save the result as a text file
5 - use mcjVooDooDaz to import this data in Daz Studio. This creates an animated camera and (optionally) an object ( a cloud of marker cones )
6 - use mcjExportCameraToPZ3 to save the camera and its animation as a PZ3 file
Carrara
7 - In Carrara, import the animated camera ( the pz3 file ) and optionally the cloud of markers produced by mcjVooDooDaz
8 - set the sequence of numbered images as Carrara's animated background
Poser ( tested in Poser 7 )
7 - In poser, unfortunately importing the pz3 file does not work. Instead, Open the pz3 file ( File / Open ).
8 - set the sequence of numbered images as Poser's animated background ( Use background shader mode )
Installation
The installation package can be found at the bottom of this page in the attachments section
Unzip this in your daz content folder
on a typical Windows PC this means C:
program files\Daz\Studio\Contents
The script should now appear in your Library in the Studio / Scripts / mcasual folder
Example for Carrara
1 - shoot a short ( ideally under 8 seconds ) video
I shot this 3 seconds long video in HD720p ( 1280x720 ) at 30 fps
( click for animated view )
2 - Convert the video into a sequence of numbered images
Canon pocket cameras produce Quicktime (.mov) video files.
I used ffmpeg and the batchfile shown below to convert the video into
a series of numbered images. If you are not familiar with batch files,
then you could use a program like WinFF to convert the .mov file into an .avi file
then use virtualDub's File/Export/Image sequence menu to convert the
.avi file into a sequence of numbered images
Only use this method if you are familiar with batch files.
The following batch file creates a folder named 4171
then it extracts numbered images from the video file MVI_4171.MOV
this makes use of the freeware ffmpeg which i previously installed in my c:\ffmpeg\ folder
md 4171
c:\ffmpeg\ffmpeg.exe -i MVI_4171.MOV -f image2 -sameq -vcodec mjpeg .\4171\img-%%03d.jpg
pause
I now have 90 jpg images in my F:\zi6_0590\2011-09-21-1518-28\4171 folder
they are named : pic000.jpg, pic001.jpg ... pic089.jpg
3 - perform camera tracking in Voodoo or Voocat
open VooDoo
Click on File / Open / Sequence
Browse up to and select the first image in your sequence of numbered images
ex: F:\zi6_0590\2011-09-21-1518-28\4171pic000.jpg
since i was walking with the camera, i select "free move" as the Move Type
Click on File / Open Initial Camera
select a type that matches the camera used
ex: i picked HDTV 16:9 since my camera produced 1280x720 images
ideally one would use real values for Film Back and Focal length
but choosing a type with a correct Aspect ratio is often enough
I click on VooDoo's "Track" button
processing takes a few minutes
4 - Save the result as a text file
File / Save / TextFile
I save all markers
Note: saving a limited number of markers takes a long time
specify the location and name of the textFile ex: F:\zi6_0590\2011-09-21-1518-28\4171\4171.txt
5 - use mcjVooDooDaz to import this data in Daz Studio
See the instruction manual of mcjVooDooDaz for further details
- open Daz Studio
- launch mcjVooDooDaz which is located in Studio/Scripts/mcasual
- Click the [ Select Voodoo file ... ] button
- browse up to the Voodoo-produced text file ex: F:/zi6_0590/2011-09-21-1518-28/4171/4171.txt
- Click the [ Select First Backdrop ] button
- browse to the first image of your numbered image sequence ex: F:/zi6_0590/2011-09-21-1518-28/4171/pic000.jpg
- Click the [Set backdrop For Current Frame ] button
the onscreen background should change,
sometimes you must exit mcjVooDooDaz for the backdrop change to occur
- Click the [(Re)build Voodoo Camera] button
this creates an animated camera named VoodooCamera
- Click the [Build and Save point-cloud object file] button
- specify the location and name for the point cloud object ex: F:/zi6_0590/2011-09-21-1518-28/4171/4171.obj
- Click the [Load last saved point-cloud object] button
Click the [Exit] button
make voodooCamera the current view camera
select the markers cloud ( in this case an object named "4171" ) and change it's surface ambient color to green 100%
you should now see something like this
if you want to continue working in Daz Studio using mcjVooDoodaz's services
please refer to its instruction manual
6 - use mcjExportCameraToPZ3 to save the camera and its animation as a PZ3 file
select the VooDooCamera camera
launch mcjExportCameraToPZ3which should be located in Studio / Scripts / mcasual
select the target program. Carrara by default
Click the [Export] button
- specify the output file ex: F:\zi6_0590\2011-09-21-1518-28\4171\4171_Carrara.pz3
7 - In Carrara, import the animated camera and the cloud of markers produced by mcjVooDooDaz
- Open Carrara
- Do a File / Open
- select the pz3 file you created in step 6 F:\zi6_0590\2011-09-21-1518-28\4171\4171_Carrara.pz3
- import the marker cloud object which was created in when you
used mcjVoodooDaz's [Build and Save point-cloud object file] button
ex: F:/zi6_0590/2011-09-21-1518-28/4171/4171.obj
when mcjVooDooDaz saved the markers-cloud object
it used 1 unit = 1 cm
a Carrara unit is 1 inch or 2.54cm
so we uncheck the "auto-scaling" option and use
One OBJ unit equals 0.393700787 Carrara units
and we uncheck the "auto-position" option
- Click on View / Show production frame
you can see Carrara's production frame has a default aspect ratio of 4:3 but we use a 16:9 aspect ratio video so ...
- Click on Render / Output and set the output size to something like 640x360 or 1280x720
- select the markers cloud ( named 4171 in our example ) and make it bright green
the result, we clearly see the cloud of markers
8 - Set the sequence of numbered images as Carrara's animated background
In the hierarchy tree, select the "Scene"
click on "Backdrop"
Change if from its default value of "None" to "Map"
Click on the Open button and select the first image in your sequence of numbered images
ex: F:/zi6_0590/2011-09-21-1518-28/4171/pic000.jpg
when the "Chose File Format" pop-up appears
make sure to choose "sequenced jpeg" instead of the default "jpeg"
Another popup appears and we specify we're using 30fps
On the timeline we go to the last frame of the VoodooCamera animation ( ex: frame 89 )
and in the backdrop-map panel we move the image selector to the last frame
When we imported the animated camera it came parented to a node named "Universe"
to make it possible to resize the markers-cloud (4171.obj in our example ), you should parent
the markers-cloud node to the "Universe" node, as shown below. When you need to resize,
move or rotate the markers-cloud, instead, resize the "Universe" node, this way you are
resizing the camera as well.
Use the markers-cloud as a guide when placing 3D objects in the scene
be careful not to modify the VooDooCamera orientation or position.
In the following video you can see the result of adding a cube in the scene
( the pole on the fire hydrant breaks the illusion of the cube resting on the brick pavement,
though your brain may find a valid explanation for what's happening :) )
Example for Poser
Steps 1 to 5 are the same as for Carrara
6 - use mcjExportCameraToPZ3 to save the camera and its animation as a PZ3 file
select the VooDooCamera camera
launch mcjExportCameraToPZ3which should be located in Studio / Scripts / mcasual
select the target program. Poser
Click the [Export] button
- specify the output file ex: F:\zi6_0590\2011-09-21-1518-28\4171\4171_Carrara.pz3
7 - In Poser, Import the camera and the markers-cloud.
- load the camera
important note: In poser, unfortunately, importing the pz3 file ( File /Import ) does not load
our animated camera properly, Instead we do a File / Open
- load the markers cloud
mcjVooDooDaz saved the markers-cloud object (4171.obj in our example) with a factor of 1 unit = 1 cm
But Poser interprets .obj files as using a factor of 1 unit = 8 ft
we would have to resize the markers-cloud to 0.41%
this would make the markers-cloud very difficult to handle in Poser
So, in Daz Studio, load the markers-cloud (4171.obj in our example)
Export it ( File / Export / Wavefront object )
when asked for export options, specify Poser Units
save it under a name like "Markers_4171_poser.obj"
note that Poser has issues with names that start with numerals like our "4171.obj" file had.
Back in Poser
Import the markers-cloud, by doing a File / Import/ Wavefront object
use the following settings to avoid resizing
8 - set the sequence of numbered images as Poser's animated background ( Use background shader mode )
Set the Production frame size to the movie output size
Go in Display / Render settings / Movie Settings
and set the resolution appropriately, in our example, 1280x720
Go in the materials room, select the Background node
disconnect "BG Color", connect "BG Movie"
select your video footage
Check-marking the "Auto_Fit" check-box seems necessary for Firefly renders
I used virtualDub to convert my series of images into an AVI file.
Quick VirtualDub instructions:
- File / Open
- select the first image in your sequence
- go in Video / Frame rate, change the rate to 30 ( it's 10 by default )
- by default the file is saved uncompressed, a big file, but always accepted by Poser
- optional : go in Video / Compression, select a codec that Poser accepts
- File / Save As Avi
Optional
Go in the properties tab of the markers cloud
check-mark the "Display Origin" check-box.
Back in the parameters tab, set the Origin to 0, 0, 0
( by default the origin is at an unworkable position )
Go in the hierarchy editor ( Window / Hierarchy Editor )
Check-mark "Show Cameras"
Make the camera a child node of the markers cloud using drag-and-drop
This way, if you need to resize the markers-cloud,
you are also, properly, resizing the camera path
Position your 3d objects in reference to the markers,
positionning the 3d objects based only on the background image is possible but difficult.
For my example video, i looked at the markers-cloud using the "Left" camera
and rotated the markers-cloud ( and hence, the VoodooCamera" ) until the ground markers were horizontal
i then moved the markers cloud down until the ground markers were on Poser's ground
this way, the ground shadows generated by Poser increase realism.
watch the video !