Author Topic: Maxscript - Stopping render and restarting doesn't work  (Read 3278 times)

2017-01-19, 13:52:07

3dwannab

  • Active Users
  • **
  • Posts: 362
    • View Profile
Code: [Select]
viewport.ResetAllViews() --resets to Max Standard
viewport.setGridVisibility #all false
max tool zoomextents all
viewport.activeViewportEx 2
actionMan.executeAction 0 "40406"  -- Views: Extended Views
viewport.activeViewportEx 3

fn stopCoronaIR_fn =
(
   if (classof renderers.current == CoronaRenderer) AND CoronaRenderer.CoronaFp.getRenderType() == 2 then -- docked type
   (
      CoronaRenderer.CoronaFp.stopRender()
      )
   )
stopCoronaIR_fn ()

CoronaRenderer.CoronaFp.startInteractiveDocked()

So the above code doesn't work in the second time of running. First will start. Second should stop and restart but it's not working and it seems to lock the listener also.


I want to easily stop the docked render and start it for the sake of a script I'm writing. I was hoping not to have to create a timer to do restart after I stop it. Reparsing doesn't work for my needs.


But this is just a hack for me to rename maps in the slate material editor while an IR renderer is working. Stop it, rename maps, restart it is what I thought needs to be done to rename them successfully.


Sometimes my script renames the SME nodes, sometimes not. This is definitely linked to IR being active.
« Last Edit: 2017-01-19, 13:56:17 by 3dwannab »

2017-04-01, 23:31:07
Reply #1

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
this should be fixed tranks to recent maxscript IR fixes. Can you try it just to be sure?
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2017-04-02, 00:41:52
Reply #2

3dwannab

  • Active Users
  • **
  • Posts: 362
    • View Profile
Yip, case closed. :)
« Last Edit: 2017-04-02, 01:51:33 by 3dwannab »

2017-04-02, 01:50:25
Reply #3

3dwannab

  • Active Users
  • **
  • Posts: 362
    • View Profile
Nope. Sorry about that.


Just keep evaulating this stripped down code:
Code: [Select]
CoronaRenderer.CoronaFp.stopRender()
CoronaRenderer.CoronaFp.startInteractiveDocked()


It's stop and starts the render. When it should in theory stop and start every time.


Here's another variation to test:
Code: [Select]
if CoronaRenderer.CoronaFp.stopRender() == 2 then CoronaRenderer.CoronaFp.startInteractiveDocked() else CoronaRenderer.CoronaFp.stopRender() ; CoronaRenderer.CoronaFp.startInteractiveDocked()

2019-01-13, 15:49:50
Reply #4

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Can you try it now? Now it should be definitely fixed ;) (corona v3)
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2019-05-03, 16:40:27
Reply #5

3dwannab

  • Active Users
  • **
  • Posts: 362
    • View Profile
Sorry for been such a slow coach.


it does now. Work that is :)