Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: 3dwannab on 2019-08-08, 15:02:15

Title: Maxscript render to texture - How to remove error message and not show the vfb
Post by: 3dwannab on 2019-08-08, 15:02:15
This is the error message that I'm getting.

Code: [Select]
===== Warning(36) =====
Distributed rendering from a free (non-camera) view can lead to incorrect results.
If you see incorrectly overlapped objects, render from a camera view.

Then even with the vfb:off switch it still shows the vfb.

Code here:
Code: [Select]

fn shakeAndBake o pxl =
(
  local o = $
  o.iNodeBakeProperties.removeAllBakeElements()
  diffuseColor = Corona_DiffuseColor()
  diffuseColor.outputSzX = diffuseColor.outputSzY = pxl
  diffuseColor.fileType = (getDir #image+"\\"+o.name+"_diffuse.png")
  diffuseColor.fileName = filenameFromPath diffuseColor.fileType
  diffuseColor.enabled = true
  o.INodeBakeProperties.addBakeElement diffuseColor
  select o
  --This is where the vfb is set to off but it still shows
  render rendertype:#bakeSelected vfb:off progressBar:true outputSize:[pxl,pxl]
  )
theObject = shakeAndBake theObject 512
Title: Re: Maxscript render to texture - How to remove error message and not show the vfb
Post by: maru on 2019-08-14, 12:28:38
Sorry, but I do not understand the issue. Can you please describe what you are doing and what is happening?

You are using Render To Texture feature via maxscript?
And then you are getting some error message, and you would like to close that error message and hide the VFB?
Is that correct?
Title: Re: Maxscript render to texture - How to remove error message and not show the vfb
Post by: 3dwannab on 2019-08-14, 12:35:09
If you select an object with a corona material applied and run that code above it gives an error in the corona error dialog like so:

How can this be avoided?
(https://i.imgur.com/zbnplVO.png)

Regards hiding the vfb, it still displays even though vfb:off is in the bakeselected function.
Title: Re: Maxscript render to texture - How to remove error message and not show the vfb
Post by: rowmanns on 2019-08-14, 13:15:03
Hi,

That error message only should appear if you have DR enabled when rendering with a non camera view.

Is there a chance you have DR enabled?

Thanks,

Rowan
Title: Re: Maxscript render to texture - How to remove error message and not show the vfb
Post by: 3dwannab on 2019-08-14, 16:54:01
That was it. Thanks, it's always the simplest things. I thought it had something to do with the bakemap function.

Is there a way possible to not open the vfb during rendering out the baked maps inside the bakemaps fn with vfb:off?
Title: Re: Maxscript render to texture - How to remove error message and not show the vfb
Post by: maru on 2019-08-15, 10:04:55
So you had DR enabled, and that's why the error message would pop up? Right?
Title: Re: Maxscript render to texture - How to remove error message and not show the vfb
Post by: rowmanns on 2019-08-15, 10:11:51
Hi,

Are you talking about the Max VFB or the Corona VFB?

If it's the Corona VFB you can use something like CoronaRenderer.CoronaFp.showVfb(false) to hide it.

https://corona-renderer.com/wiki/maxscript

Cheers,

Rowan
Title: Re: Maxscript render to texture - How to remove error message and not show the vfb
Post by: 3dwannab on 2019-08-15, 10:35:47

So you had DR enabled, and that's why the error message would pop up? Right?

It wasn't a scene created by me, it was from someone else.


Are you talking about the Max VFB or the Corona VFB?

If it's the Corona VFB you can use something like CoronaRenderer.CoronaFp.showVfb(false) to hide it.

https://corona-renderer.com/wiki/maxscript (https://corona-renderer.com/wiki/maxscript)
Corona. Ok, I know of that method. It's just I thought that it should not show with vfb:off.


Thanks.