Mesh smoothing disabled in scene opened by script - help? [SOLVED]

I'm having problems with a script to batch render scenes in Iray.

TL;DR
The script will open a scene (or scenes) from files and render each camera in the scene to a file, but clothing items are showing poke-through which does not show when the same scene is opened manually and then rendered manually.  The same poke-through is evident if I disable mesh smoothing on the clothing items after manually opening the scene file.

More info.
The script uses the openFile method of App.getContentMgr() to open the scene file.  Then, for each camera in the scene, it renders to a named file.  It has no effect on the poke-through issue whether it renders using a Dz3DViewRenderHandler object or a DzImageRenderHandler - have tried both, same problem.

I have added code after the scene file has been opened and before the rendering begins to identify all the nodes in the scene with an 'Enable Smoothing' property, and to display its value.  It's a boolean property, and the values for all items showing poke-through are 'true'.  I expect this to represent 'enabled', but then why the poke-through.  Even aside from the poke-through, it's obvious the items are not smoothed in the rendered image.

Once the scene has been opened by the script and the scripted render has finished, there is no poke-through in the viewport (unless I disable mesh smoothing) and it doesn't show if I start a render manually.  It only seems to be a problem when the render is done by the script.

Has anyone else come across this issue before?  Any ideas on how to diagnose/work around/ fix this much appreciated, as it is pretty much a show stopper and I am stuck!

Post edited by andya_b341b7c5f5 on

Comments

  • Hae you tried using a time to delay rendering? I seem to recall there was an issue, though I also thought I recalled its being fixed long since.

  • I actually did try a timer - about 30 seconds I think - which didn't help.  I could try longer, I guess.

    However, I should have said this is using DS 4.9.4.122 Public Beta (64-bit).  When you say there was a problem but it was fixed a long while ago, do you have any idea how long ago?  I'm not very keen to upgrade - it always seems there all the fixes are counter-balanced by a bunch of new issues.

  • I can't recall - it's a prety vague memory.

  • Well, I seem to have got a work around.  I found some older forum threads via Google, and based on these I tried the following:

    1. Sleeping (again), for up to 5 mins, just after opening the scene file(s) - no effect on the issue.

    2. Waiting for the active background process to become inactive after opening the scene file - this made sense so thought it would work, but has no effect on the issue, and did not appear to have to wait at all.

    3. Forcing a redraw of the 3D viewport with repaintActive3DViewport() method of the viewport manager object after opening the scene file - no effect on the issue.

    4. Enabling the 'interactive update' property on the nodes (clothing) that have an 'Enable Smoothing' property i.e. a smoothing modifier - appears to solve the issue.  I have no clear idea what this property is intended for, or why it helps here, but it does.  Since I am not saving the files after rendering, I'm not bothering to set it back to disabled.

    So now the script is able to open all the .duf files in a specified directory, iterate through the cameras and render an image from each camera to a file in a specified directory, using Iray. 

    Thanks for pointing me in the right direction.

     

Sign In or Register to comment.