Notifications
Clear all

[Closed] 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

16 Replies
1 Reply
(@rustyknight)
Joined: 10 months ago

Posts: 0

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…

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.

1 Reply
(@rustyknight)
Joined: 10 months ago

Posts: 0

I guess it all depends on the approach you are taking, but you could use “frame: <number> | #current” parameter of the render function

Have you tried Start Time = 0; End Time = 0?

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…

  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...

substring <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 "%
" cam.name)

And see what you get…

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…

[left]<string>substring <string> <from_integer> <length_integer>
[/left]
[left]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. [size=3]If a negative value is specified for [/size]length_integer, the remainder of the string starting from from_integer is returned.
[/left]

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??

major triple post hiccup

major triple post hiccup

major triple post hiccup

Page 1 / 2