PDA

View Full Version : incompatable types


Bixel
10-26-2007, 03:50 AM
for a in cameras do
(
outputfilename = "uvm"+ (substring ((10000 + i) as string) 2 4)
outPath = getFilenamePath "E:\\3dsmax9\\Output\\"
result = render camera:a frame:#current outputFile: (outPath + outputfilename + ".png") vfb:off
)


getting this error "incompatable types = 10000 and unidentified" on this line
>>> outputfilename = "uvm"+ (substring ((10000 + i) as string) 2 4)

I dont understand this code has worked perfectly before

RustyKnight
10-26-2007, 04:16 AM
for a in cameras do
(
outputfilename = "uvm"+ (substring ((10000 + i) as string) 2 4)
outPath = getFilenamePath "E:\\3dsmax9\\Output\\"
result = render camera:a frame:#current outputFile: (outPath + outputfilename + ".png") vfb:off
)


getting this error "incompatable types = 10000 and unidentified" on this line
>>> outputfilename = "uvm"+ (substring ((10000 + i) as string) 2 4)

I dont understand this code has worked perfectly before
I want you to look very carefully at:
1. The error message
2. The code snippet you've provided.

It is, from what you've provided, very obvious why this isn't working.

If you still can't pick, walk the code...

Bixel
10-26-2007, 04:22 AM
Oppps!!! Hahahahah oh my eyes. Thanks.

ALSO. I have a second question, I have a couple of current scripts that render each frame in the framerange (i.e timeconfiguration). However, what if I want it to render only 1 frame? Start Time 0 and End Time 1 always produces Frame Count 2 or two frames. Whats the deal?? How can I force 1 frame - since Time Configuration overrides the Render Dialog's single frame setting.

RustyKnight
10-26-2007, 04:26 AM
Oppps!!! Hahahahah oh my eyes. Thanks.

ALSO. I have a second question, I have a couple of current scripts that render each frame in the framerange (i.e timeconfiguration). However, what if I want it to render only 1 frame? Start Time 0 and End Time 1 always produces Frame Count 2 or two frames. Whats the deal?? How can I force 1 frame - since Time Configuration overrides the Render Dialog's single frame setting.I guess it all depends on the approach you are taking, but you could use "frame: <number> | #current" parameter of the render function

focomoso
10-26-2007, 04:46 AM
Start Time 0 and End Time 1 always produces Frame Count 2 or two frames. Whats the deal?? How can I force 1 frame - since Time Configuration overrides the Render Dialog's single frame setting.
Have you tried Start Time = 0; End Time = 0?

Bixel
10-26-2007, 05:10 AM
Got another problem, I am trying to name the output file's suffix with the camera's suffix. But I am having a hard time getting the camera's name to break in the code for later use. So I tried this - since you cant use camera.name I tried to trick it by saying for a in cameras, then coverting cameras[a] to something else

for a in cameras.count do
(
local thecams = cameras[a]
camnames = thecams.name
suffix = (substring camnames 6)
for n = 1 to thecams.count do
(
outputfilename = "uvm"+ (substring ((10000 + suffix) as string) 2 4)
outPath = getFilenamePath "E:\\3dsmax9\\Output\\"
render camera:a frame:a outputFile: (outPath + outputfilename + ".png") vfb:on
)
)


so if I had Camera1 hopefully file name would be uvm0001, its important that the filename = camera name #.

However its giving me this error "No "map" function for 12" --- What is that?

@ Focomoso. At least changing it manually - It will not let you. However I suppose I could jus change it in the script -- I might have to resort to that if this becomes a problem. Or just to do Frame:1

RustyKnight
10-26-2007, 05:26 AM
Got another problem, I am trying to name the output file's suffix with the camera's suffix. But I am having a hard time getting the camera's name to break in the code for later use. So I tried this - since you cant use camera.name I tried to trick it by saying for a in cameras, then coverting cameras[a] to something else

for a in cameras.count do
(
local thecams = cameras[a]
camnames = thecams.name
suffix = (substring camnames 6)
for n = 1 to thecams.count do
(
outputfilename = "uvm"+ (substring ((10000 + suffix) as string) 2 4)
outPath = getFilenamePath "E:\\3dsmax9\\Output\\"
render camera:a frame:a outputFile: (outPath + outputfilename + ".png") vfb:on
)
)


so if I had Camera1 hopefully file name would be uvm0001, its important that the filename = camera name #.

However its giving me this error "No "map" function for 12" --- What is that?

@ Focomoso. At least changing it manually - It will not let you. However I suppose I could jus change it in the script -- I might have to resort to that if this becomes a problem. Or just to do Frame:1I'm not even sure I know where to start...

No "map" function for 12
Is the interruprters way of saying it does not have a function or other method to deal with the identifier "12"...now you need to ask yourself, why 12?


for a in cameras.count doTell me what is wrong with this line!


Substring requires three parameters...you need to read the docs...
<string>substring <string> <from_integer> <length_integer>Therefore:
suffix = (substring camnames 7 -1)should work.

since you cant use camera.name
In theory you can, but having looked back at what you are saying, I think you've confused your self...

Try...
for cam in cameras do (
format "%\n" cam.name)And see what you get...

Bixel
10-26-2007, 06:10 AM
well this works

for a in cameras do
(
camnames = a.name
suffix = (substring camnames 7 1) as integer
outputfilename = "uvm"+ (substring ((10000 + suffix) as string) 2 4)
outPath = getFilenamePath "E:\\3dsmax9\\Output\\"
render camera:a outputFile: (outPath + outputfilename + ".png") vfb:off
)

but this > suffix = (substring camnames 7 -1) does not, I now understand that 7 is the 1 in camera1, but a length of -1?? So here's the good news, with vfb on I can see its rendering all my cameras. And it is outputing all my cameras (4 cameras, 4 file 0001, 0002..etc). However unlike the vfb render pass, my output is all black???

However, my timconfig is set to start 0 end 1, which for some reason says its 2 frames. I noticed while previewing the output that during the script run.. I do get a proper image, but it is then overwritten with the black output.

RustyKnight
10-26-2007, 06:15 AM
well this works

for a in cameras do
(
camnames = a.name
suffix = (substring camnames 7 1) as integer
outputfilename = "uvm"+ (substring ((10000 + suffix) as string) 2 4)
outPath = getFilenamePath "E:\\3dsmax9\\Output\\"
render camera:a outputFile: (outPath + outputfilename + ".png") vfb:off
)

but this > suffix = (substring camnames 7 -1) does not, I now understand that 7 is the 1 in camera1, but a length of -1?? So here's the good news, with vfb on I can see its rendering all my cameras. And it is outputing all my cameras (4 cameras, 4 file 0001, 0002..etc). However unlike the vfb render pass, my output is all black???

However, my timconfig is set to start 0 end 1, which for some reason says its 2 frames. I noticed while previewing the output that during the script run.. I do get a proper image, but it is then overwritten with the black output.And what about camera 10?

Please read the docs, very carefully...

<string>substring <string> <from_integer> <length_integer>

Returns a new string consisting of the substring in string starting at index from_integer, and of length length_integer. If the sum of from_integer and length_integer is greater than the length of string, a shorter string is returned containing as many characters as are available in the source. If a negative value is specified for length_integer, the remainder of the string starting from from_integer is returned.


Start = 0; End = 1 = 2 frames...it's like saying start = 1; End = 2 = 2 frames

Frame 0 is 1 frame AND frame 1 is 1 frame, which makes....<ta-da> 2 frames! Sorry, it's getting late in the day and I've been coding all day

You need to either render by "frame:" or specifiy a render range of x to x...

Wasn't this mentioned before??

Bixel
10-26-2007, 06:23 AM
major triple post hiccup

Bixel
10-26-2007, 06:28 AM
major triple post hiccup

Bixel
10-26-2007, 06:33 AM
major triple post hiccup

Bixel
10-26-2007, 06:35 AM
**strange forum bug lost my response in the internets**

I already understood that start 0 end 1 = 2 frames, I was flabbergasted that you cant get it lower that 2 frames, say you just want 1 frame, Time Configuration will not allow you to set start 0 end 0 for instance or start 1 end 1. So -- anyway I can prolly do it with code. However new problems, all my outputs are black - nothing. Yet! If you preview through the pngs in the output folder with the windows viewer while it is running the script you get a sneak peak of the correct render - before it mysteriously get overwritten with the black image. Almost as if it is rendering each frame twice but replaceing the 1st file with pure black.

Bixel
10-26-2007, 05:24 PM
Fixed it. It was outputing black because I was using target cameras, as soon as I made the free it solved it.

focomoso
10-26-2007, 06:59 PM
Fixed it. It was outputing black because I was using target cameras, as soon as I made the free it solved it.
You sure that was it? Target vs. free cameras shouldn't make any difference in the output.

thatoneguy
10-26-2007, 08:55 PM
I was flabbergasted that you cant get it lower that 2 frames, say you just want 1 frame.

How about this:
rendTimeType -- integer
Get/set the type of time range to be rendered.
Possible values are:
1 - Single frame.
2 - Active time segment (animationRange).
3 - User specified Range.
4 - User specified Frame pickup string (for example "1,3,5-12"). See rendPickupFrames below.

RustyKnight
10-26-2007, 11:32 PM
Fixed it. It was outputing black because I was using target cameras, as soon as I made the free it solved it.Actually, there is nothing wrong with targeted cameras, but you haven't done enough research into what the camera's collection is returning.

The camera's collection will also return the "target" helpers, as well as the camera's themselves. So with one target camera in the scene, we can do:
for cam in cameras do
format "%\n" camwhich outputs something like...
$Target_Camera:Camera01 @ [46.125462,-0.000001,29.520296]
$Target:Camera01.Target @ [-71.955719,0.000001,-23.616236]
So if we then do something like:
for cam in cameras do
format "%\n" (classof cam) we get:
Targetcamera
Targetobject

Therefore, if we were to filter the result such:
for cam in cameras do (
-- Check for anytype of camera...
if (isKindOf cam Camera) then
/* Do your work here */
)
)Your code would still work

Shane

CGTalk Moderation
10-26-2007, 11:32 PM
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.