Alarm for V-ray (SOLVED)

Alarm for V-ray (SOLVED)

Postby Tax » Sat Sep 04, 2021 1:44 am

An extension witch plays some music or pop a msgbox once V-ray has finished render.
Any aproach ideas on this?

I found no prints of it on SU console but it has its own "V-ray progress window":
V-ray progress window.png

Could we acess/detect its last logs?

obs: I use V-ray 3.6 on SU2018 on Win10-64bits

Thanks
0
Last edited by Tax on Sun Sep 05, 2021 6:08 pm, edited 1 time in total.
"Between cause and consequence, lots of connivance."
"Never felt being on same level as others; just bc Ive never been."
User avatar
Tax 
PluginStore Author
PluginStore Author
 

Re: How to code an alarm for V-ray?

Postby Tax » Sat Sep 04, 2021 9:34 am

Just realized V-ray changes its toolbar icons while rendering:
V-ray toolbar.png


bet the best aproach would be an observer; would appreciate help on coding it.
0
"Between cause and consequence, lots of connivance."
"Never felt being on same level as others; just bc Ive never been."
User avatar
Tax 
PluginStore Author
PluginStore Author
 

Re: How to code an alarm for V-ray?

Postby Tax » Sun Sep 05, 2021 2:27 am

Realized that eventually it may end up on UI::Command class matter.
So I'm thinking about a simplier (even shitty) workaround:

1º aproach: observer
2º aproach: toolbar class?
3º aproach: pixel color <<<

v-ray stop.png


New questions: (assuming its always gonna be the same pixel coord)
- How to read screen pixels? directly?
- Screenshot? how to write and read?
- is "color check at every 10s" a good practice? better suggestion?
0
"Between cause and consequence, lots of connivance."
"Never felt being on same level as others; just bc Ive never been."
User avatar
Tax 
PluginStore Author
PluginStore Author
 

Re: How to code an alarm for V-ray?

Postby Tax » Sun Sep 05, 2021 6:05 pm

(SOLVED)

It`s actually pretty simple. Thanks to DanRathbun on:
https://forums.sketchup.com/t/how-to-tell-if-v-ray-render-has-finished/133293
Code: Select all
if VRay::LiveScene.active.rendering?
   @Timer = UI.start_timer(5,true) {
      if !VRay::LiveScene.active.rendering?
         print "Render is complete."
         UI.beep
         UI.stop_timer(@Timer)
         break
      end
      print "V-ray render check"
   }
else
   print "Render hasn't started. Try again."
end

Works like a charm!
2
Last edited by Tax on Sun Nov 27, 2022 6:44 am, edited 1 time in total.
"Between cause and consequence, lots of connivance."
"Never felt being on same level as others; just bc Ive never been."
User avatar
Tax 
PluginStore Author
PluginStore Author
 

Re: Alarm for V-ray (SOLVED)

Postby Dan Rathbun » Wed Dec 15, 2021 5:41 pm

Just a note that calling the == method with a true or false argument for a Boolean conditional expression is considered poor practice.

Ie, ...
if VRay::LiveScene.active.rendering? == false
... it is completely unnecessary to make a method call here as the Vray::LiveScene method calls return a Boolean result and the interpreters if evaluates the Boolean expression.

So the interpreter must evaluate an extra expression that is either:
false == false or true == false
1
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: Alarm for V-ray (SOLVED)

    Postby Tax » Sun Nov 27, 2022 6:46 am

    Thanks, its fixed now.

    You always pro :D
    0
    "Between cause and consequence, lots of connivance."
    "Never felt being on same level as others; just bc Ive never been."
    User avatar
    Tax 
    PluginStore Author
    PluginStore Author
     

    SketchUcation One-Liner Adverts

    by Ad Machine » 5 minutes ago



    Ad Machine 
    Robot
     



     

    Return to Developers' Forum

    cron

    Who is online

    Users browsing this forum: No registered users and 9 guests