Volume domain is visible when use render into Blender. #40769

Closed
opened 2014-06-23 11:47:29 +02:00 by Pedro A. · 12 comments
Contributor

System Information
Ubuntu 14.04 x64 and Windows XP 32 bits

Blender Version
Blender 2.71 RC2 from build bot
Short description of error
Volume domain is visible if use render 'into blender' from my exporter / integration (TheBounty, forked from YafaRay).
volume_domain2.png
Render 'to image file' work OK.
volume_domain.png

That is the code use for 'integrate' render 'into blender' viewer:

def render(self, scene):
      if scene.name == 'preview':
          self.is_preview = True
      scene = scene.bounty
      
      postprocess = self.bl_use_postprocess
    #
      self.bl_use_postprocess = False   
      if scene.gs_type_render == "file" and not self.is_preview:
          self.yi.printInfo("Exporter: Rendering to file {0}".format(self.outputFile))
          
          self.yi.render(self.co)
          result = self.begin_result(0, 0, self.resX, self.resY)
          lay = result.layers[0]
        # exr format has z-buffer included, so no need to load '_zbuffer' - file
          if scene.gs_z_channel and not scene.img_output == 'OPEN_EXR':
              lay.load_from_file("{0}_zbuffer.{1}".format(self.output, self.file_type))
          else:
              lay.load_from_file(self.outputFile)
          self.end_result(result)
      elif scene.gs_type_render == "xml" and not self.is_preview:
          self.yi.printInfo("Exporter: Writing XML to file {0}".format(self.outputFile))
          self.yi.render(self.co)
      else:# into blender
          def progressCallback(command, *args):
              if not self.test_break():
                  if command == "tag":
                      self.tag = args[0]
                  elif command == "progress":
                      self.prog = args[0]
                  self.update_stats("TheBounty Render: ", "{0}".format(self.tag))
                #
                  self.update_progress(self.prog)
          def drawAreaCallback(*args):
              x, y, w, h, tile = args
              res = self.begin_result(x, y, w, h)
              try:
                  lay = res.layers[0]
                  lay.rect, lay.passes[0].rect = tile
              except:
                  pass
              self.end_result(res)
          def flushCallback(*args):
              w, h, tile = args
              res = self.begin_result(0, 0, w, h)
              try:
                  lay = res.layers[0]
                  lay.rect, lay.passes[0].rect = tile
              except BaseException as e:
                  pass
              self.end_result(res)
              
        # define thread
          thread = threading.Thread(target=self.yi.render,
                               args=(self.resX, self.resY,
                                     self.bStartX, self.bStartY,
                                     self.is_preview,
                                     drawAreaCallback,
                                     flushCallback,
                                     progressCallback)
                               )
        # run..
          thread.start()
          while thread.isAlive() and not self.test_break():
              time.sleep(0.2)
          if thread.isAlive():
              self.update_stats("", "Aborting...")
              self.yi.abort()
              thread.join()
    #
      self.yi.clearAll()
      del self.yi
      self.update_stats("", "Done!")
      self.bl_use_postprocess = postprocess

Exact steps for others to reproduce the error
I think this error may be related to the alpha channel of the viewport.
I have reviewed the information on RenderEngine struct API in Blender, without success.
RenderEngine struct
Any suggestions or ideas to solve this error?

**System Information** Ubuntu 14.04 x64 and Windows XP 32 bits **Blender Version** Blender 2.71 RC2 from build bot **Short description of error** Volume domain is visible if use render 'into blender' from my exporter / integration (TheBounty, forked from YafaRay). ![volume_domain2.png](https://archive.blender.org/developer/F95335/volume_domain2.png) Render 'to image file' work OK. ![volume_domain.png](https://archive.blender.org/developer/F95337/volume_domain.png) That is the code use for 'integrate' render 'into blender' viewer: ``` def render(self, scene): if scene.name == 'preview': self.is_preview = True scene = scene.bounty postprocess = self.bl_use_postprocess ``` # ``` self.bl_use_postprocess = False ``` ``` if scene.gs_type_render == "file" and not self.is_preview: self.yi.printInfo("Exporter: Rendering to file {0}".format(self.outputFile)) self.yi.render(self.co) result = self.begin_result(0, 0, self.resX, self.resY) lay = result.layers[0] ``` # exr format has z-buffer included, so no need to load '_zbuffer' - file ``` if scene.gs_z_channel and not scene.img_output == 'OPEN_EXR': lay.load_from_file("{0}_zbuffer.{1}".format(self.output, self.file_type)) else: lay.load_from_file(self.outputFile) self.end_result(result) ``` ``` elif scene.gs_type_render == "xml" and not self.is_preview: self.yi.printInfo("Exporter: Writing XML to file {0}".format(self.outputFile)) self.yi.render(self.co) ``` ``` else:# into blender ``` ``` def progressCallback(command, *args): if not self.test_break(): if command == "tag": self.tag = args[0] elif command == "progress": self.prog = args[0] self.update_stats("TheBounty Render: ", "{0}".format(self.tag)) ``` # ``` self.update_progress(self.prog) ``` ``` def drawAreaCallback(*args): x, y, w, h, tile = args res = self.begin_result(x, y, w, h) try: lay = res.layers[0] lay.rect, lay.passes[0].rect = tile except: pass ``` ``` self.end_result(res) ``` ``` def flushCallback(*args): w, h, tile = args res = self.begin_result(0, 0, w, h) try: lay = res.layers[0] lay.rect, lay.passes[0].rect = tile except BaseException as e: pass ``` ``` self.end_result(res) ``` # define thread ``` thread = threading.Thread(target=self.yi.render, args=(self.resX, self.resY, self.bStartX, self.bStartY, self.is_preview, drawAreaCallback, flushCallback, progressCallback) ) ``` # run.. ``` thread.start() ``` ``` while thread.isAlive() and not self.test_break(): time.sleep(0.2) ``` ``` if thread.isAlive(): self.update_stats("", "Aborting...") self.yi.abort() thread.join() ``` # ``` self.yi.clearAll() del self.yi self.update_stats("", "Done!") self.bl_use_postprocess = postprocess ``` **Exact steps for others to reproduce the error** I think this error may be related to the alpha channel of the viewport. I have reviewed the information on RenderEngine struct API in Blender, without success. [RenderEngine struct ](http://www.blender.org/documentation/blender_python_api_2_71_0/bpy.types.RenderEngine.html#bpy.types.RenderEngine.render) Any suggestions or ideas to solve this error?
Author
Contributor

Changed status to: 'Open'

Changed status to: 'Open'
Author
Contributor

Added subscriber: @povmaniac

Added subscriber: @povmaniac
Member

Added subscriber: @totoro-4

Added subscriber: @totoro-4
Member

Are you sure the domain is completely transparent when rendering into the image file? All colors are different so perhaps it's some color space problem? (premultiplied alpha?)

Are you sure the domain is completely transparent when rendering into the image file? All colors are different so perhaps it's some color space problem? (premultiplied alpha?)

Added subscriber: @Sergey

Added subscriber: @Sergey

It would really help saving bunch of time if you isolate exact operator or api call in blnderspython API which doesn't give you expected results, than asking us to extract this information from your renderer which involved loads of API communication, threading and so..

It would really help saving bunch of time if you isolate exact operator or api call in blnderspython API which doesn't give you expected results, than asking us to extract this information from your renderer which involved loads of API communication, threading and so..

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2014-07-02 16:03:23 +02:00

No news in one week, closing.

No news in one week, closing.
Author
Contributor

Sorry, I don,t have some time this week for review this code, because I need solved job issues far on my city. Re-open task, please..

Sorry, I don,t have some time this week for review this code, because I need solved job issues far on my city. Re-open task, please..

We'll reopen once you answer sergey's request. Keeping unusable (for us) reports open is just useless. :)

We'll reopen once you answer sergey's request. Keeping unusable (for us) reports open is just useless. :)
Author
Contributor

sergey, the python 'bindings' code for this code (drawAareaCallback, flushCallback, etc..) its here:
bindings
I really don't know what callback are don't work right.
Maybe the problen is on Blender 'image viewer'.. instead on RenderEngine code.

sergey, the python 'bindings' code for this code (drawAareaCallback, flushCallback, etc..) its here: [bindings ](https://github.com/TheBounty/Core/blob/master/src/bindings/yafrayinterface.i) I really don't know what callback are don't work right. Maybe the problen is on Blender 'image viewer'.. instead on RenderEngine code.

@povmaniac, i have no idea how the yafray bindings are expected to work and don't have time trying to understand what that code expects from us. We really need a simple case which demonstrates that some API call in blender doesn't work as it's expected. And this is much easier to do by those who are trying to use the API and doesn't get results he expects.

For us it'll take days just trying to understand what someone's code is trying to do.

@povmaniac, i have no idea how the yafray bindings are expected to work and don't have time trying to understand what that code expects from us. We really need a _simple_ case which demonstrates that some API call in blender doesn't work as it's expected. And this is much easier to do by those who are trying to use the API and doesn't get results he expects. For us it'll take days just trying to understand what someone's code is trying to do.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#40769
No description provided.