PDA

View Full Version : Saving Camera's Name in Save File area


Teriander
04-09-2008, 12:31 AM
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. ??

erilaz
04-09-2008, 12:38 AM
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

Teriander
04-09-2008, 12:55 AM
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?

Kramsurfer
04-09-2008, 01:18 AM
ShowProperties < MAx Node > -- will display them in the listener
or
getpropnames < Max Node > -- will return an array of property names for an object.

erilaz
04-09-2008, 01:20 AM
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.

Teriander
04-09-2008, 01:32 AM
Thanks a lot guys!

Teriander
04-09-2008, 02:59 AM
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?

Kramsurfer
04-09-2008, 05:37 PM
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...

Teriander
04-09-2008, 06:12 PM
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 :D Thanks a lot!

LoneRobot
04-10-2008, 11:09 AM
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.

CGTalk Moderation
04-10-2008, 11:09 AM
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.