Announcement

Collapse
No announcement yet.

How to close Asset Editor of Vray by ruby?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to close Asset Editor of Vray by ruby?

    I need to close Asset Editor dialog of Vray using Ruby to prevent from this error (please see image). This error happens when Asset Editor is opening, then I run the following code twice times and the error appears.

    I realize that if Asset Editor is closing before I run code then the error doesn’t appear.
    Code:
    context = VRay::Context.active #Assume that vray::context was active before
    if not context.nil?
    context = VRay::Context
    context.active(false)&.delete
    end
    Click image for larger version

Name:	Screenshot 2024-03-19 215209.png
Views:	114
Size:	107.1 KB
ID:	1204853

  • #2
    It is unclear to me what you are trying to achieve exactly.

    The snippet you shared seems odd. If there is no active context it will create one and then immediately delete it. Because of the asynchronous nature of our user interface, this could leave our asset editor open and in a buggy state. Simply closing the Asset editor is unlikely to address the underlying issue.

    Perhaps you could share some more context about what you're trying to achieve?

    Comment


    • #3
      noel.warren You are right, closing the Asset Editor doesn’t solve the problem. That’s my mistake.

      This error happens when I run this code (context.active(false)&.delete) following your previous suggesstion in another thread to increase the speed of executing code. To reproduce, you need to open Asset Editor manually then run the above code that I provided.

      If there’s no way to fix this error then what is the command to hide the V-Ray Log Window (I don’t wanna show the V-Ray Log Window)?

      Thanks for your support!​

      Comment

      Working...
      X