Saving Camera's Name in Save File area

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Display Modes
  04 April 2008
Saving Camera's Name in Save File area

Im trying to create a script that will write the file name of the selected camera inside my Output Filename area in my renderer. Everything works fine, except my camera name has more information in the output file than I need. It reads like "View_Camera:Camera01 @ [9.9,0.0,-65].rpf"

How can I clean that up to only show "Camera01.rpf" ?

Here is my code

edittext txtSavePath FieldWidth:360
 selectedCamera = viewport.getCamera() as string
 			SaveFile = txtSavePath.text + selectedCamera +".rpf"
 			
 			rendOutputFilename = SaveFile


the textbox is to allow the user to type the directory, then the script gives the file name... Any sugesstions on how to clean this up?


ALSO!
Is it possible to edit the .rpf settings from the script? For example, enable Z-Depth, keep 16bit, Enable G-Buffer, etc. ??

Last edited by Teriander : 04 April 2008 at 11:35 PM.
 
  04 April 2008
Try adding this:




 
edittext txtSavePath FieldWidth:360 selectedCamera = viewport.getCamera() --note I removed the string() part
cameraName = selectedCamera.name
SaveFile = txtSavePath.text + cameraName +".rpf" rendOutputFilename = SaveFile
__________________
"There Really is No Secret"
Martin Brennand - mocha Product Manager - Imagineer Systems
 
  04 April 2008
That's exactly what I needed! It works great now! How did you know what variables are available for you to use? Like how did you know .name would be available for my viewport.GetCamera() ?

Thanks a lot for responding so fast.. Any suggestion on my .rpf question?
 
  04 April 2008
ShowProperties < MAx Node > -- will display them in the listener
or
getpropnames < Max Node > -- will return an array of property names for an object.
__________________
Keith R Morrison
www.focus360.com

XP Pro x64, Win 7 - Max 2009, Max 2013 - Vray 2.30.01 - Backburner (uhg)
 
  04 April 2008
Originally Posted by Teriander: That's exactly what I needed! It works great now! How did you know what variables are available for you to use? Like how did you know .name would be available for my viewport.GetCamera() ?

Thanks a lot for responding so fast.. Any suggestion on my .rpf question?


Pretty much all nodes, whether they be geometry, lights, cameras etc. have access to the property .name. It's basically the same property you use when you create any node in code. For example:

 newBox = box name:"BoxTest" position:[1,1,1]


As to your RPF question, check out RPF: BitmapI0 in the maxscript help. This should give you what you need.
__________________
"There Really is No Secret"
Martin Brennand - mocha Product Manager - Imagineer Systems
 
  04 April 2008
Thanks a lot guys!
 
  04 April 2008
Originally Posted by Kramsurfer: ShowProperties < MAx Node > -- will display them in the listener
or
getpropnames < Max Node > -- will return an array of property names for an object.


How can I show properties for the Renderer? The Renderer dialog box does not list to the listener. Is it possible to list the variables or settings that the render dialog box is using?
 
  04 April 2008
It's all in the MaxScript Help file.. I like to keep my help file on the index tab, and just type in what ever it is you're looking for...I also have a shortcut to the help file on my start bar, that way WHEN max crashes, you still have the last topic you where help'n yourself to...

You'll find alot of the general renderer variables have global names, the rest can be found this way...

showproperties renderers.production
getpropnames renderers.production

Good Luck...

__________________
Keith R Morrison
www.focus360.com

XP Pro x64, Win 7 - Max 2009, Max 2013 - Vray 2.30.01 - Backburner (uhg)
 
  04 April 2008
I just typed showproperties renderers.production in the maxscript, and it listed everything I needed to know for my renderer variables! This is something I've been looking for! Thanks a lot of showing me this!!

I use the MaxScript Help Referrence often, but I sometimes get lost or can't find the answer Im looking for.. Like in this case, I couldn't find something as simple as
showproperties renderers.production .. The community makes it so much easier to understand Thanks a lot!
 
  04 April 2008
There is a topic that most people probably skirt over in the MXS help - Inheritance and polymorphism, that describes what martin and keith are talking about. It means how objects within OOP programming inherit the properties of their parent class. So the box class inherits the geometryclass, which inherits properties from the node class. The light blue box underneath any max object in the MXS help will confirm this. Another useful topic is Node Common properties, operators and Methods.

the inheritance topic really helped me start understanding how the dotnet classes work - as OOP object handling is similar in someways, but infinitely more powerful once you get the idea of what an "Object" can actually encompass.

for example, at the moment im writing a vb.net application that handles images. nothing fancy there, but i have written a custom class to expose properties and methods that i want to use all the time. so in the imageops class i will have access to the following properties and methods -

filename
extension
imagesize
path
full path
last save
date created
width
height
colordepth
GDI+ bitmap
Grayscale bitmap
ResizeBitmap

thus, when i want to retrieve an image, i create an object that is an instance of the imageOps class. this means I can access all the properties of this custom class in a more organised way.



__________________
Regards,
Pete

Read my technical blog - lonerobot.net

Last edited by LoneRobot : 04 April 2008 at 12:58 PM.
 
  04 April 2008
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:12 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.