mcjExportCamToDs -- Export animated cameras from Blender to Daz Studio 1,2,3,4

mCasualmCasual Posts: 4,607
edited February 2013 in Freebies

Download page : https://sites.google.com/site/mcasualsdazscripts2/mcjexportblendercam

────────────────────────────────────────────────────
Introduction
────────────────────────────────────────────────────

This python script for Blender will let you export animated cameras from Blender

in a format ( daz script ) compatible with Daz Studio versions 1, 2, 3, 4 and 4.5

The export data contains the Focal Length(s) too.

────────────────────────────────────────────────────

note that i also have on my site daz scripts to export Daz Studio cameras to Blender, Poser and Carrara

demonstration video : https://docs.google.com/leaf?id=0B74NpQ_FHc6cSkgyNGt5aDRNWnM

────────────────────────────────────────────────────

so you could have an image/animation pipeline like this

-- create a camera animation using Blender's marker/camera tracking services

-- Export the animated camera to Daz Studio

-- Insert a Daz Studio / Poser character in the scene

-- Render it in Daz Studio, or render it in Blender and the Cycles renderer using my mcjTeleblender Script

mcjCameraOk.png
910 x 910 - 979K
rotata.gif
320 x 180 - 812K
Post edited by mCasual on

Comments

  • Hello! it is amazing and it could solve my problem which I want to import Blender motion track camera into Daz studio but I can't get the older version of Daz studio no more... is there any possibility that you will update the script to make it compatible to DS 4.12?

  • mCasualmCasual Posts: 4,607

    i think if you rename the files from .ds to .dsa they should be compatible with DS4.12

    in fact i think the .ds files should be accepted by DS4.12

    Hello! it is amazing and it could solve my problem which I want to import Blender motion track camera into Daz studio but I can't get the older version of Daz studio no more... is there any possibility that you will update the script to make it compatible to DS 4.12?

     

  • mCasual said:

    i think if you rename the files from .ds to .dsa they should be compatible with DS4.12

    in fact i think the .ds files should be accepted by DS4.12

    Hello! it is amazing and it could solve my problem which I want to import Blender motion track camera into Daz studio but I can't get the older version of Daz studio no more... is there any possibility that you will update the script to make it compatible to DS 4.12?

     

    The scripting language did change, the engine will attempt to convert though there are cases where syntax that works in either version will cause the conversion to fail. I suspect just changing the extension, while it may work in specific cases, is not a generally safe approach.

  • mCasualmCasual Posts: 4,607
    edited October 2020

     most of my .ds scripts that dont deal with meshes survive the conversion to .dsa by ds3 and ds4

    but the dsa ones sometimes need small fixes to work with ds1, ds2

    lets see about this one ... ah dang it ... it's one of my rare a blender python scrips ... from the Blender 2.62 days so i doubt it works with Blender 2.83

    lets be brave and test it

    Oh Yay! it still works with Blender 2.83

    and ... in blender you are asked to give the camera animation script to be named anyname.dsa

    and it's very old school code that would work with DS 1,2,3,4

    var cameraName = "VoodooCam";var blFilmbackWidth = 36.000000;var fps = 24.000000;var data = [[1, 50.000000, 7.358891, -6.925791, 4.958309, 0.483536, 0.208704, 0.336872, 0.780483 ],[2, 50.000000, 7.364675, -6.910235, 4.960306, 0.483536, 0.208704, 0.336872, 0.780483 ],[3, 50.000000, 7.381481, -6.865033, 4.966110, 0.483536, 0.208704, 0.336872, 0.780483 ],[4, 50.000000, 7.408494, -6.792379, 4.975437, 0.483536, 0.208704, 0.336872, 0.780483 ],[5, 50.000000, 7.444895, -6.694470, 4.988007, 0.483536, 0.208704, 0.336872, 0.780483 ],[6, 50.000000, 7.489870, -6.573503, 5.003536, 0.483536, 0.208704, 0.336872, 0.780483 ],[7, 50.000000, 7.542602, -6.431673, 5.021745, 0.483536, 0.208704, 0.336872, 0.780483 ],[8, 50.000000, 7.602273, -6.271175, 5.042349, 0.483536, 0.208704, 0.336872, 0.780483 ],[9, 50.000000, 7.668069, -6.094208, 5.065069, 0.483536, 0.208704, 0.336872, 0.780483 ],[10, 50.000000, 7.739172, -5.902966, 5.089621, 0.483536, 0.208704, 0.336872, 0.780483 ],[11, 50.000000, 7.814765, -5.699645, 5.115724, 0.483536, 0.208704, 0.336872, 0.780483 ],[12, 50.000000, 7.894032, -5.486442, 5.143095, 0.483536, 0.208704, 0.336872, 0.780483 ],[13, 50.000000, 7.976158, -5.265552, 5.171453, 0.483536, 0.208704, 0.336872, 0.780483 ],[14, 50.000000, 8.060325, -5.039173, 5.200516, 0.483536, 0.208704, 0.336872, 0.780483 ],[15, 50.000000, 8.145716, -4.809499, 5.230002, 0.483536, 0.208704, 0.336872, 0.780483 ],[16, 50.000000, 8.231516, -4.578728, 5.259628, 0.483536, 0.208704, 0.336872, 0.780483 ],[17, 50.000000, 8.316907, -4.349054, 5.289114, 0.483536, 0.208704, 0.336872, 0.780483 ],[18, 50.000000, 8.401073, -4.122675, 5.318177, 0.483536, 0.208704, 0.336872, 0.780483 ],[19, 50.000000, 8.483198, -3.901785, 5.346535, 0.483536, 0.208704, 0.336872, 0.780483 ],[20, 50.000000, 8.562466, -3.688582, 5.373907, 0.483536, 0.208704, 0.336872, 0.780483 ],[21, 50.000000, 8.638060, -3.485261, 5.400009, 0.483536, 0.208704, 0.336872, 0.780483 ],[22, 50.000000, 8.709162, -3.294019, 5.424561, 0.483536, 0.208704, 0.336872, 0.780483 ],[23, 50.000000, 8.774958, -3.117052, 5.447280, 0.483536, 0.208704, 0.336872, 0.780483 ],[24, 50.000000, 8.834629, -2.956555, 5.467885, 0.483536, 0.208704, 0.336872, 0.780483 ],[25, 50.000000, 8.887362, -2.814725, 5.486094, 0.483536, 0.208704, 0.336872, 0.780483 ],[26, 50.000000, 8.932336, -2.693758, 5.501624, 0.483536, 0.208704, 0.336872, 0.780483 ],[27, 50.000000, 8.968737, -2.595849, 5.514194, 0.483536, 0.208704, 0.336872, 0.780483 ],[28, 50.000000, 8.995750, -2.523195, 5.523521, 0.483536, 0.208704, 0.336872, 0.780483 ],[29, 50.000000, 9.012556, -2.477992, 5.529324, 0.483536, 0.208704, 0.336872, 0.780483 ],[30, 50.000000, 9.018339, -2.462437, 5.531321, 0.483536, 0.208704, 0.336872, 0.780483 ],[31, 50.000000, 9.018339, -2.462437, 5.531321, 0.483536, 0.208704, 0.336872, 0.780483 ],[32, 50.000000, 9.018339, -2.462437, 5.531321, 0.483536, 0.208704, 0.336872, 0.780483 ]];var todeg = 180 / Math.PI;var aspectRatio = App.getRenderMgr().getRenderOptions().aspect;var dzFilmbackHeight = 35var cam = new DzBasicCamera();cam.setName( cameraName );Scene.addNode( cam );var tick = Scene.getTimeStep();var n = data.lengthvar datum, pos, q, euler, t, dsFl, rx, ry, rz;var XrotCtl = cam.getXRotControl()var YrotCtl = cam.getYRotControl()var ZrotCtl = cam.getZRotControl()var flCtl = cam.getFocalLengthChannel();for( i = 0; i < n; i++ ){datum = data[i];t = datum[0] * tick;pos = new DzVec3( datum[2] * 100, datum[4] * 100, -datum[3] * 100 );cam.setWSPos( t, pos );q = new DzQuat( datum[5]*.99999, datum[7]*.99999, -datum[6]*.99999, datum[8] )euler = q.getValue( 2, 1, 0 );rx = -( euler.x * todeg + 90 );ry = -( euler.y * todeg );rz = -( euler.z * todeg );ZrotCtl.setValue( t, rz );XrotCtl.setValue( t, rx );YrotCtl.setValue( t, ry );dsFl = aspectRatio * datum[1] * dzFilmbackHeight / blFilmbackWidth;flCtl.setValue( t, dsFl );}

     

     

    mCasual said:

    i think if you rename the files from .ds to .dsa they should be compatible with DS4.12

    mCasual said:

    in fact i think the .ds files should be accepted by DS4.12

    Hello! it is amazing and it could solve my problem which I want to import Blender motion track camera into Daz studio but I can't get the older version of Daz studio no more... is there any possibility that you will update the script to make it compatible to DS 4.12?

     

    The scripting language did change, the engine will attempt to convert though there are cases where syntax that works in either version will cause the conversion to fail. I suspect just changing the extension, while it may work in specific cases, is not a generally safe approach.

     

    Post edited by mCasual on
  • I have tested it at 2.79b, and at 2.92 with a Miku Miku Dance VMD camera .. It only exports a frontal view, not a prespective view. Although I have converted the camera to Blender, it remains the same with the generated dsa. I have used the MMD Tools for Blender, and there is no way. Everything is far away, and without changes of angles. Is there any solution?

     

  • mCasualmCasual Posts: 4,607
    I made a version of mcjTeleBlender that exports daz studio scenes as fbx, and that script or the corresponding Blender script corrects the angles and positions that dont transfer correctly during fbx export/import. And if i remember correctly it also transfers camera animations if you search mcjTeleblender fbx on my site or in this forum, you should find it, other versions of mcjTeleblender transfered cameras correctly tho
  • No, Jacques (I think is your real name ... The mine is Georges ..). Previously, I have used your TeleBlender, but it is not the case. The camera animation is from Blender to Daz, not the other way around. As I mentioned, it is a "Motion camera" in Vmd format from MikuMikuDance. I have used it from Maya / MotionBuilder, with Fbx, but it seems that D | S does not recognize any zoom, but positions. With your script, only a front view comes out. If I do it in Cinema 4D, with the https://github.com/AiMiDi/C4D_MMD_Tool plugin, and I export with a bake in fbx, it does recognize its animation, as long as I bind a camera to the object. But, as I said, it does recognize the movements, but leaves out the zoom or any FOV. I think it's not your script's fault, but the animation limitations of a Daz camera. Great Mysteries of Biblical History!  laugh

  • mCasualmCasual Posts: 4,607

    maybe you could try converting your FBX to an older FBX version, or cpnvert it to binary or ascii FBX format

    autodesk has a free app in the dusty recesses of its empire named uh fbxconvert? yes

    https://www.autodesk.com/developer-network/platform-technologies/fbx-converter-archives

    also if you read the ascii version of the fbx using notepad, you may find solutions there, like search and replace channel names or somethin

    autodolor said:

    No, Jacques (I think is your real name ... The mine is Georges ..). Previously, I have used your TeleBlender, but it is not the case. The camera animation is from Blender to Daz, not the other way around. As I mentioned, it is a "Motion camera" in Vmd format from MikuMikuDance. I have used it from Maya / MotionBuilder, with Fbx, but it seems that D | S does not recognize any zoom, but positions. With your script, only a front view comes out. If I do it in Cinema 4D, with the https://github.com/AiMiDi/C4D_MMD_Tool plugin, and I export with a bake in fbx, it does recognize its animation, as long as I bind a camera to the object. But, as I said, it does recognize the movements, but leaves out the zoom or any FOV. I think it's not your script's fault, but the animation limitations of a Daz camera. Great Mysteries of Biblical History!  laugh

Sign In or Register to comment.