Page Menu
Home
Search
Configure Global Search
Log In
Paste
P2851
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Jacques Lucke (JacquesLucke)
on Mar 24 2022, 11:48 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
import
bpy
from
bpy.app.handlers
import
persistent
is_in_function
=
False
def
updateNodeTree
(
self
,
context
):
global
is_in_function
if
is_in_function
:
return
is_in_function
=
True
tree
=
self
.
id_data
if
tree
.
bl_idname
==
'BatchNodesTree'
:
for
_
in
range
(
3
):
for
node
in
tree
.
nodes
:
node
.
update
()
for
window
in
bpy
.
data
.
window_managers
[
0
]
.
windows
:
for
area
in
window
.
screen
.
areas
:
area
.
tag_redraw
()
is_in_function
=
False
@persistent
def
updateNodeTreeTimerThread
():
for
tree
in
bpy
.
data
.
node_groups
:
if
tree
.
bl_idname
==
'BatchNodesTree'
:
for
_
in
range
(
3
):
for
node
in
tree
.
nodes
:
node
.
update
()
for
window
in
bpy
.
data
.
window_managers
[
0
]
.
windows
:
for
area
in
window
.
screen
.
areas
:
area
.
tag_redraw
()
return
1.0
def
updateNodeTreeTimer
(
range
):
#import threading
#th = threading.Thread(target=updateNodeTreeTimerThread)
#th.start()
#th.join()
for
tree
in
bpy
.
data
.
node_groups
:
if
tree
.
bl_idname
==
'BatchNodesTree'
:
for
_
in
range
(
3
):
for
node
in
tree
.
nodes
:
node
.
update
()
for
window
in
bpy
.
data
.
window_managers
[
0
]
.
windows
:
for
area
in
window
.
screen
.
areas
:
area
.
tag_redraw
()
#print('Update time is: ', range)
return
range
def
update_timerUpdateTree
(
self
,
context
):
import
functools
bpy
.
app
.
timers
.
unregister
(
updateNodeTreeTimer
)
bpy
.
app
.
timers
.
register
(
functools
.
partial
(
updateNodeTreeTimer
,
bpy
.
context
.
scene
.
time_update
))
Event Timeline
Jacques Lucke (JacquesLucke)
created this paste.
Mar 24 2022, 11:48 AM
Jacques Lucke (JacquesLucke)
mentioned this in
T96394: Regression: Missing update in custom Nodetree
.
Mar 24 2022, 11:50 AM
Log In to Comment