incompatable types

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2007   #1
incompatable types


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
 
Old 10 October 2007   #2
Originally Posted by Bixel:

 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...
 
Old 10 October 2007   #3
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.
 
Old 10 October 2007   #4
Originally Posted by Bixel: 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
 
Old 10 October 2007   #5
Originally Posted by Bixel: 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?
__________________
----
fo co mo so
 
Old 10 October 2007   #6
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
 
Old 10 October 2007   #7
Originally Posted by Bixel: 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
I'm not even sure I know where to start...
Quote: 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 do
Tell me what is wrong with this line!


Substring requires three parameters...you need to read the docs...
Quote: <string>substring <string> <from_integer> <length_integer>
Therefore:

         	suffix = (substring camnames 7 -1)
should work.

Quote: 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...
 
Old 10 October 2007   #8
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.
 
Old 10 October 2007   #9
Originally Posted by Bixel: 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...
Quote:
<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??
 
Old 10 October 2007   #10
major triple post hiccup

Last edited by Bixel : 10 October 2007 at 06:36 AM.
 
Old 10 October 2007   #11
major triple post hiccup

Last edited by Bixel : 10 October 2007 at 06:36 AM.
 
Old 10 October 2007   #12
major triple post hiccup

Last edited by Bixel : 10 October 2007 at 06:36 AM.
 
Old 10 October 2007   #13
**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.
 
Old 10 October 2007   #14
Fixed it. It was outputing black because I was using target cameras, as soon as I made the free it solved it.
 
Old 10 October 2007   #15
Originally Posted by Bixel: 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.
__________________
----
fo co mo so
 
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 11:38 PM.


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