I have changed the script to make the camera move up instead of down. (redownoad from link on first post)
Your After Effects scenes do point out that the camera and z-distance calculations are off. I am not sure how to correct it at this time.
When I made the 2.49 version of this script I simply cloned an existing exporter that supported Maya, Max and Lightwave. Lightwave was the closest match at that time. So the camera math is essentially for lightwave. I made this script public with the hope that someone a bit more savy on calculations might be able to offer up some suggestions. But all I can offer at this time is to say “play with the camera sensor size and focal length”.
I have wanted to revisit the concept of how to implement a Blender unit in After Effects I just have not had the time.
Thank you for the update I understand that you’re busy, that’s what makes me thankful even more I often think that many people posting here (or in other places, doing regular tutorials, writing free plugins, scripts etc.) are almost like superheroes
I wish I could help more. There’s one more thing that comes to my mind - I had a chance to check PFHoe by Pixel Farm (it was the cheapest tracking solution at one moment) in the past and it had the ability to export script files for Blender 2.49. There were feature requests on their forum to update for 2.5 but they haven’t done it so far. This software is now discontinued so I think that’s it. But maybe there is something in the code that PFHoe was producing which could help here. I don’t know, maybe it’s AE problem. If you want to look into the code here’s an example script file I got some time ago:
It’s for 2.49 however, so I possibly it’s useless. Thanks again
Well, Atom said the script is not finished, updating it would take much time. I guess we just have to wait, maybe somebody comes up with a solution. I really need that functionality too. Someday we’ll get there.
Atom, if you’re reading this - have you archived the old version somewhere? The one which was working with blender 2.49? I googled like crazy but all the links are dead. We can still use it, save the file then open in new Blender. I thinks it’s a good workaround for now. Thanks
I’d gladly help with this script, but I’m not good enough with jsx. I tried to go through this several times and gave up.
I think that the math here is a bit too complex and conversion can be done easier. For example I noticed that angles are used to convert AE’s lens to blender’s lens. This is not necessary. I’m sure about it, because I made all the calculations myself for the exporter from Blender to AE which is included in Blender. I didn’t at all use angles and everything sits precisely where it should.
I can do all the math, but I would have problems implementing it into existing script that I don’t quite understand.
Wow! Bartek Skorupa and Atom in one thread I’m crazy about using two-way workflow between Blender and After Effects so your script Bartek is just sooooo useful. Now we need the other half I’ve used the contact form on your website some time ago to ask you about any solutions but I don’t know if the form is working. Do you remember getting my message? If you didn’t have time to answer no problem - we’re all so busy these days.
Back to the topic - I don’t have any programming skills, I’m just a user that needs some features, so I cannot really help. I can test, I can feedback. I really think we need those scripts, tracking in AE is just so easy and fast (if there’s a problem we can use the Foundry’s plugin which helps even more). It would be great to take that data into Blender.
Bartek - I’ve published in this thread an old code exported from PFhoe. It was a cheap tracking software which could export data to Blender. It was Blender 2.49, however, so I don’t know how useful is this data.
I am willing to field questions for the parts of the code that are confusing. Remember, I built this from an existing working exporter for Maya, Max and Light Wave. So some math conversions for the camera may have been needed for those applications.
collectValueAtCurrentTime_XZY_Camera is where all animations data that will be written out for the camera is collected, calculated and returned to the caller. Put override values here to test your ability to alter the output stream.
Also getFLenOrFOVorZFacFromZoom has some math I do not understand.
You can ignore anything related to Masking at this time. It was a work in progress even in the 2.49 script. I left some code in there so I would not have to look it up again.
myStr = pythonDir(unknownVar);
Thanks for working on this. I’ve been using AE CS6, which has built in 3D camera tracking that works quite well, not to mention easily and quickly. I’d love to be able to build my composition in AE, and export a camera and some nulls to Blender in order to create some 3D text or objects with Cycles rendering.
@loogas: Sorry for the late reply, but I am finally looking back into making this script work better. After some research I realize that the script is missing the sensor size for your footage. While the script can look at the After Effects camera sensor size, it can’t really know what sensor size the footage was shot with. Do you happen to know what camera was used to for the footage you have posted? If so, it might be possible to simply set the After Effects lens and sensor size to match the lens and sensor of the camera that shot your footage.
As a side note (if you happen to have some time to read it ;)):
I’ve been checking online tutorials to look into camera “interchangeability” between different packages - 3dmsax, maya, pftrack, nuke, after effects, cinema4d - and this functionality is there. I wonder how they achieved in on the coding side. I mean you don’t even have to know what was the camera that the footage was shot with etc.
I don’t know how many people would need this functionality in Blender but something like this was a major feature in the last 3dsmax (you can import whole scene data into AE and back) and is being advertised for the upcoming update of AE (great interoperability with Cinema 4d). I really don’t want to leave Blender and learn another package, all over again
I have revised the After Effects To Blender exporter to update it for Blender 2.6.6 api changes.
As far as tracking and camera matching tasks, however, we are still in untested waters.
For example I noticed that angles are used to convert AE’s lens to blender’s lens. This is not necessary.
@Bartek: Thanks for the tip, I have revised the lens zoom calculation with a magic # that seems to match your export code for tested camera zooms. I transfered 5 cameras with different zoom values from Blender2AE2Blender without any distortion to the lens or LOC/ROT of the cameras.
There is a lot of math in the exporter that I don’t understand either, having taken it from the Maya/Max/Lightwave exporter years ago. Internally I think the original authors of that script turned After Effects zoom values in to radians for internal calculations and thus it needs converted back for final output.
@Atom: Let’s assume that I do all the math. If I do it and give you all the formulas, would you be able to implement this in your exporter?
Let’s say I give you data like this:
location.x = AE_position_x * something minus something else plus comp_width
location.y = blabliblebli.
When it comes to camera data, I’d assume using default camera settings (I mean sensor, “fit” etc.) and match all the math to those settings.
Math here should be easy. I’d assume that we have the access to “zoom” value in AE. If so - I can easily create a proper equation, like:
blender_lens = comp_width * something minus something times zoom.
Will it help?
Maybe this way we could somehow ignore all those crazy “RadiansToDegreesToRadiansAgainToAnythingElseThatIsNotNeeded” stuff?
It’s nice to see you’re still trying to figure things out guys
Well, the only thing I can do to help is to keep testing, so I did. It’s better but still something is off.
First of all, you have to know I didn’t export anything from Blender, then back to Blender. I’ve used a situation I face almost every day - I’ve tracked the footage inside AE (fast track, not fully tested), created a scene, a camera and some 3d solids for reference.
Let’s say I want to take this to Blender (it’s an unused shot from a tornadoes and destruction music video I did a while ago), add stuff to the ground, the building in the background, and then render to compose in AE.
I’ve run the script (I hope I’ve used the correct version, the bottom one from the first page of this thread: ATOM_AE2Blender26_04162013.jsx) in CS6 and CS5. Then I tried to use the resulting .py files in Blender 2.66a - it doesn’t work, some error. But this doesn’t matter - we cannot expect Atom to keep updating it all the time I’ve run it in Blender 2.63a and here it works, it creates the scene and stuff. The camera seems to be shifted in its position to the right. What’s more, if I use the ouput from CS6, the camera is below the ground (but again, let’s leave CS6 for now, if it works at least in CS5 that’s gonna be great).
I thought first that maybe camera parenting to a scene-controlling null is a problem, but if you unparent it so it displays it’s true position in space and then export, you get the same result.
I hope this doesn’t discourage you Atom (and Bartek ;)). Zhajym reported it works for him - could you tell us more? Have you created a scene in Blender, went to AE, then back to Blender, or it all started in AE?
If you need the scene and my files to look into them, like with the previous case you’ve checked, you can find them here:
By the way:
Even though I don’t like marketing mumbo jumbo about how great the dynamic link between AE and Premiere is (it can fail you in some really demanding situations) it usually works nice, so what do you mean Veggiet by saying that AE is not compatible with Premiere? They work great together. Premiere is and editing software - why would you like to export to Blender? Or maybe you’re talking about Blender’s sequencer, not 3d space? That would be a completely different matter
Thanks for the test files, verified, the script does not work. I just don’t know enough about the math to make the camera work correctly. The objects seem to be in the correct location. But the camera is just fracked.
No problem. Thanks for coming back to this - maybe some solution will come up eventually. By the way - do you still have the older version of your script which worked for Blender 2.49 and AE CS3? All links are dead but I think it could be used as workaround for now. Thanks in advance