Swizl
0
Camera Aspect Ratio Script
I'm trying to learn scripting and have been playing around with JavaScript in Codecademy. My problem now is moving over to doing some of it in C3d. I figured I'd give myself a project to try and start figuring it out. I've done some basic writing for the UI and some ideas on what needs to be done, but not how to go about doing it (see notes in the attached script for more detail). I'd like it first to just be a way to easily pick standard pixel dimensions so I don't have to keep looking them up. Then I'd like to expand that to increase the dimensions to match an increased dpi since C3d's default is 72.
Two questions before going any further:
1.) Can you access the camera pixel dimensions in C3d using a script, or is that not possible with the API?
2.) Does this script have to be a Polygonobj script? I was thinking a tool script may work better as the Position / Scale / Rotation isn't really needed. I couldn't get it to even load the UI when I put it in the Tool script folder. It's no big deal to have it there, just would look cleaner without it.
Any suggestions to get me started are most welcome!
P.S. What IDE do most of you use when writing your code? I've just been using Dashcode, but if there is something better, please suggest some.
Thanks,
Simon
Edit:
I've now added a second modified script that works with v7 since the pixel dimensions have been removed from the camera over to the render engines. podperson and Martin both helped me a great deal in getting this back up and running. I've removed the Imperial and Metric sections from this new one. It can be added back in or the entries I've put in mine can be changed to whatever someone wants them to be.
I'm trying to learn scripting and have been playing around with JavaScript in Codecademy. My problem now is moving over to doing some of it in C3d. I figured I'd give myself a project to try and start figuring it out. I've done some basic writing for the UI and some ideas on what needs to be done, but not how to go about doing it (see notes in the attached script for more detail). I'd like it first to just be a way to easily pick standard pixel dimensions so I don't have to keep looking them up. Then I'd like to expand that to increase the dimensions to match an increased dpi since C3d's default is 72.
Two questions before going any further:
1.) Can you access the camera pixel dimensions in C3d using a script, or is that not possible with the API?
2.) Does this script have to be a Polygonobj script? I was thinking a tool script may work better as the Position / Scale / Rotation isn't really needed. I couldn't get it to even load the UI when I put it in the Tool script folder. It's no big deal to have it there, just would look cleaner without it.
Any suggestions to get me started are most welcome!
P.S. What IDE do most of you use when writing your code? I've just been using Dashcode, but if there is something better, please suggest some.
Thanks,
Simon
Edit:
I've now added a second modified script that works with v7 since the pixel dimensions have been removed from the camera over to the render engines. podperson and Martin both helped me a great deal in getting this back up and running. I've removed the Imperial and Metric sections from this new one. It can be added back in or the entries I've put in mine can be changed to whatever someone wants them to be.
Attachments
Last edited: