@ -23,9 +23,10 @@ from typing import *
from . . import enum_props
from . node_core import *
from . node_deprecated import PlasmaVersionedNode
from . . import idprops
class PlasmaClickableNode ( idprops . IDPropObjectMixin , PlasmaNodeBas e , bpy . types . Node ) :
class PlasmaClickableNode ( idprops . IDPropObjectMixin , PlasmaVersioned Node , bpy . types . Node ) :
bl_category = " CONDITIONS "
bl_idname = " PlasmaClickableNode "
bl_label = " Clickable "
@ -40,9 +41,9 @@ class PlasmaClickableNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.types.N
poll = idprops . poll_mesh_objects )
bounds = enum_props . bounds (
" clickable_object " , store_on_collider = False ,
" clickable_object " ,
name = " Bounds " ,
description = " Clickable ' s bounds (NOTE: only used if your clickable is not a collider) " ,
description = " Clickable ' s bounds " ,
default = " hull "
)
@ -154,8 +155,20 @@ class PlasmaClickableNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.types.N
def _idprop_mapping ( cls ) :
return { " clickable_object " : " clickable " }
@property
def latest_version ( self ) :
return 2
def upgrade ( self ) :
# In version 1 of this node, the bounds type was stored on this node. This could
# be overridden by whatever was in the collision modifier. Version 2 changes the
# bounds property to proxy to the collision modifier's bounds settings.
if self . version == 2 :
enum_props . upgrade_bounds ( self , " bounds " )
self . version = 2
class PlasmaClickableRegionNode ( idprops . IDPropObjectMixin , PlasmaNodeBase , bpy . types . Node ) :
class PlasmaClickableRegionNode ( idprops . IDPropObjectMixin , PlasmaVersionedNode , bpy . types . Node ) :
bl_category = " CONDITIONS "
bl_idname = " PlasmaClickableRegionNode "
bl_label = " Clickable Region Settings "
@ -166,9 +179,9 @@ class PlasmaClickableRegionNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.t
type = bpy . types . Object ,
poll = idprops . poll_mesh_objects )
bounds = enum_props . bounds (
" region_object " , store_on_collider = False ,
" region_object " ,
name = " Bounds " ,
description = " Physical object ' s bounds (NOTE: only used if your clickable is not a collider) " ,
description = " Physical object ' s bounds " ,
default = " hull "
)
@ -220,6 +233,18 @@ class PlasmaClickableRegionNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.t
def _idprop_mapping ( cls ) :
return { " region_object " : " region " }
@property
def latest_version ( self ) :
return 2
def upgrade ( self ) :
# In version 1 of this node, the bounds type was stored on this node. This could
# be overridden by whatever was in the collision modifier. Version 2 changes the
# bounds property to proxy to the collision modifier's bounds settings.
if self . version == 1 :
enum_props . upgrade_bounds ( self , " bounds " )
self . version = 2
class PlasmaClickableRegionSocket ( PlasmaNodeSocketBase , bpy . types . NodeSocket ) :
bl_color = ( 0.412 , 0.0 , 0.055 , 1.0 )
@ -400,7 +425,7 @@ class PlasmaVolumeReportNode(PlasmaNodeBase, bpy.types.Node):
row . prop ( self , " threshold " , text = " " )
class PlasmaVolumeSensorNode ( idprops . IDPropObjectMixin , PlasmaNodeBas e , bpy . types . Node ) :
class PlasmaVolumeSensorNode ( idprops . IDPropObjectMixin , PlasmaVersioned Node , bpy . types . Node ) :
bl_category = " CONDITIONS "
bl_idname = " PlasmaVolumeSensorNode "
bl_label = " Region Sensor "
@ -425,7 +450,7 @@ class PlasmaVolumeSensorNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.type
type = bpy . types . Object ,
poll = idprops . poll_mesh_objects )
bounds = enum_props . bounds (
" region_object " , store_on_collider = False ,
" region_object " ,
name = " Bounds " ,
description = " Physical object ' s bounds "
)
@ -593,6 +618,18 @@ class PlasmaVolumeSensorNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.type
return ( self . find_input_socket ( " exit " ) . allow or
self . find_input ( " exit " , " PlasmaVolumeReportNode " ) is not None )
@property
def latest_version ( self ) :
return 2
def upgrade ( self ) :
# In version 1 of this node, the bounds type was stored on this node. This could
# be overridden by whatever was in the collision modifier. Version 2 changes the
# bounds property to proxy to the collision modifier's bounds settings.
if self . version == 1 :
enum_props . upgrade_bounds ( self , " bounds " )
self . version = 2
class PlasmaVolumeSettingsSocket ( PlasmaNodeSocketBase ) :
bl_color = ( 43.1 , 24.7 , 0.0 , 1.0 )