Page 1 of 2
Export / Translate ocs - camera file to fbx or maya camera
Posted: Fri Aug 19, 2011 3:23 pm
by Refracty
Hi,
for a current project I have to provide my client with the cameras I have already set up in octane. He is working in 3ds max.
The exporters usually work in the direction from 3rd party 3D app to Octane.
But know I need it the other way around.
So is there a script or tool that can parse a .ocs text file of an Octane camera and translate it to a fbx (or Maya) camera?
I didn't put this issue into the maya sub forum because it could be valuable for all users.
I appreciate any help. This is urgent.
Thank you.
Refracty
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Fri Aug 19, 2011 3:54 pm
by [gk]
if its still cameras you can read out the xyz for camera and target inside octane under the camera.
You can also locate the values in the ocs.
Manually typing them into the host app will work fine as its these numbers that's also transfered the other way.
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Fri Aug 19, 2011 6:20 pm
by Refracty
Thank you GK.
So that means that the values translate 1 to 1.
Cool, I gonna check this out.
Neverteless, to have a tool that makes all the copy pasting unnecessary would be cool.
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Fri Aug 19, 2011 6:40 pm
by tchoa
Here is a mel script that I quickly coded on the side today...
OCScameras.mel
It comes with a simple UI and should be installed as usual in a user script directory.

Use the 'OCScameras' command to launch it.
Hope that some maya users will find it useful.
Enjoy!
F
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Fri Aug 19, 2011 7:59 pm
by Refracty
WTF !
Are you a crazy genious?
You are brilliant!
Can't wait to test.
This made my day.
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Fri Aug 19, 2011 9:54 pm
by tchoa
Hmm... thanks

This is just a few lines of code. I have to say just ordinary scripting...
On the other hands the use of fileDialog2 will limit its compatibility to Maya 2011 and later.
If you want to use it with older versions you can always enter the path to the ocs file manually.
Glad it will help you!
F
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Sat Aug 20, 2011 5:59 am
by Refracty
Thank you for the hint.
I am really old school so I am using Maya 7.
I replaced fileDialog2 with the path but couldn't get it to work.
string $paths[] = `O:\3D\Octane\OCSBatch\2011_08_15_564.ocs -fm 4 -ff "Octane (*.ocs)" -sff "Octane" -cap "Load"`;
I am sure I am making fundamental mistakes in the syntax but don't know what to change.
Can you help me?
One more THANK YOU
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Sat Aug 20, 2011 7:41 am
by face
Refracty wrote:Thank you for the hint.
I am really old school so I am using Maya 7.
I replaced fileDialog2 with the path but couldn't get it to work.
string $paths[] = `O:\3D\Octane\OCSBatch\2011_08_15_564.ocs -fm 4 -ff "Octane (*.ocs)" -sff "Octane" -cap "Load"`;
I am sure I am making fundamental mistakes in the syntax but don't know what to change.
Can you help me?
One more THANK YOU
I think, because that is a string, all after ...ocs can be deleted. But let the ' alive...
Maybe you must also change $paths[] to $paths without the [].
face
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Sat Aug 20, 2011 7:02 pm
by Refracty
Thanks for the help.
I tried to modify but couldn't get it running with Maya 7.
I have changed the script around the fileDialog2 to this:
global proc OCScamerasFile()
{
string $paths = "C:\Users\Me\Documents\maya\7.0\scripts\2011_08_03_562.ocs";
textFieldButtonGrp -e -fi $paths OCSfile;
OCSgetCameras($paths);
}
If I put ' instead of " i get errors.
After the modification, the script runs through without errors but without any visible response or menue to choose the cameras.
If somebody make this running for older Maya - Versions it would be fantastic.
Tchoa, face or vipvip do you have an idea?
Re: Export / Translate ocs - camera file to fbx or maya camera
Posted: Sat Aug 20, 2011 8:14 pm
by face
Sorry, i don“t use Maya.
My hint was only because it was a sting and strings should be nearly the same in mel, vbscript, c++ or whatever...
face