How to make a quick real-time z-depth (“depth cued”) render from Poser.
The result:
How it’s done:
1. Save the Poser scene file you’re working on.
2. Turn on the Smooth Shaded display.
3. Turn on the Depth Cueing.
4. Delete all lights from the scene.
5. Make the background white.
6. Make a real-time Preview render, save it as a .JPG file.
7. Revert to the last saved file, undoing the changes.
Ok, that probably doesn’t sound all that quick. But here’s my Python script that automates all this grunt-work.
You need to make a one-time edit to the file path, in the script. Just indicate where you want rendered images to be saved. Make this simple change, save as a .PY file and then add to the C:\Program Files\Poser Software\Poser 13\Runtime\Python\poserScripts\ScriptsMenu folder. Restart Poser, and you’re ready for real-time depth map renders of your scene.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# Make a quick depth-qued auto-render from Poser. # Version 1.0 - December 2023. Tested in Poser 11 and 13. # With thanks to bwldrd for the 'SetBackgroundColor' tip. # From a saved Poser scene, auto render a quick real-time depth-map # as a .JPG on white, then revert the scene to the last saved scene file. # NOTE: The user will needs to change the output directory 'dirPath=' to their chosen path. import poser import datetime # Set up the saving and timestamp parameters. Change the save directory to suit your needs. # Remember that the \\ double slashes are vital!! This is for Windows. Mac paths may be different? dirPath="C:\\Users\\WINDOWS_USER_NAME\\FOLDER_NAME\\" ext="JPG" current_date = datetime.datetime.now().strftime ("%a-%d-%b-%Y-%H-%M-%S") # Are we dealing with a Poser scene? scene = poser.Scene() # First, we make the Ground invisible. Thus, no ground shadows or grid. # Comment out these two lines with #'s if you dont want this to happen. scene.SelectActor(scene.Actor("GROUND")) scene.Actor("GROUND").SetVisible(0) # Now we make sure the render is set to use a DPI of 300. # And switch the render engine to real-time PREVIEW mode. # This assumes the user has already set their preferred render size. scene.SetResolution(300, 0) scene.SetCurrentRenderEngine(poser.kRenderEngineCodePREVIEW) # Now delete all lights in the scene. Then redraw the Poser scene. lights = scene.Lights() for light in lights: light.Delete() scene.Draw() # Now turn on the 'Smooth Shaded' display mode. poser.ProcessCommand(1083) scene.Draw() # Now Toggle 'Depth Cue' display mode on. poser.ProcessCommand(1044) scene.Draw() # Figure style is now set to use document style, in case it wasn't for some reason. poser.ProcessCommand(1438) scene.Draw() # Set the scene's background color to white. scene.SetBackgroundColor (1.0,1.0,1.0) scene.Draw() # Now we render the scene in Preview at 300dpi and save to a .JPG file. # It must be .JPG otherwise we get a .PNG cutout with alpha and fringing. # The file is timestamped and saved into the user's preferred directory. scene.Render() scene.SaveImage(ext, dirPath + current_date) # Done. Now we revert the entire scene, to its last saved state. This means # that it doesn't matter that we changed the display modes and deleted lights. poser.ProcessCommand(7) |
Why do all this? Because AI image making can use depth-maps to recreate 3D scenes, in combination with the descriptive text prompt. AI + Poser’s content = accurate AI visuals of anything Poser has in its Library.
Pingback: What’s new for Poser and DAZ Studio, November/December 2023 – MyClone Poser and Daz Studio blog