@@ -809,6 +809,15 @@ def __initialize_fluid_simulation_settings(fluidsim, data):
809
809
fluidsim .enable_whitewater_motion_blur = \
810
810
__get_parameter_data (whitewater .generate_whitewater_motion_blur_data , frameno )
811
811
812
+ fluidsim .enable_whitewater_velocity_attribute = \
813
+ __get_parameter_data (whitewater .enable_velocity_vector_attribute , frameno )
814
+
815
+ fluidsim .enable_whitewater_id_attribute = \
816
+ __get_parameter_data (whitewater .enable_id_attribute , frameno )
817
+
818
+ fluidsim .enable_whitewater_lifetime_attribute = \
819
+ __get_parameter_data (whitewater .enable_lifetime_attribute , frameno )
820
+
812
821
is_generating_whitewater = __get_parameter_data (whitewater .enable_whitewater_emission , frameno )
813
822
fluidsim .enable_diffuse_particle_emission = is_generating_whitewater
814
823
@@ -1012,6 +1021,8 @@ def __initialize_fluid_simulation_settings(fluidsim, data):
1012
1021
__get_parameter_data (surface .enable_velocity_vector_attribute , frameno )
1013
1022
fluidsim .enable_surface_speed_attribute = \
1014
1023
__get_parameter_data (surface .enable_speed_attribute , frameno )
1024
+ fluidsim .enable_surface_vorticity_attribute = \
1025
+ __get_parameter_data (surface .enable_vorticity_vector_attribute , frameno )
1015
1026
fluidsim .enable_surface_age_attribute = \
1016
1027
__get_parameter_data (surface .enable_age_attribute , frameno )
1017
1028
fluidsim .enable_surface_color_attribute = \
@@ -1904,6 +1915,13 @@ def __write_surface_data(cache_directory, fluidsim, frameno):
1904
1915
with open (velocity_filepath , 'wb' ) as f :
1905
1916
f .write (filedata )
1906
1917
1918
+ if fluidsim .enable_surface_vorticity_attribute :
1919
+ vorticity_filename = "vorticity" + fstring + ".bobj"
1920
+ vorticity_filepath = os .path .join (cache_directory , "bakefiles" , vorticity_filename )
1921
+ filedata = fluidsim .get_surface_vorticity_attribute_data ()
1922
+ with open (vorticity_filepath , 'wb' ) as f :
1923
+ f .write (filedata )
1924
+
1907
1925
if fluidsim .enable_surface_speed_attribute :
1908
1926
speed_filename = "speed" + fstring + ".data"
1909
1927
speed_filepath = os .path .join (cache_directory , "bakefiles" , speed_filename )
@@ -1991,6 +2009,81 @@ def __write_whitewater_data(cache_directory, fluidsim, frameno):
1991
2009
with open (dust_blur_filepath , 'wb' ) as f :
1992
2010
f .write (filedata )
1993
2011
2012
+ if fluidsim .enable_whitewater_velocity_attribute :
2013
+ foam_velocity_filename = "velocityfoam" + fstring + ".wwp"
2014
+ foam_velocity_filepath = os .path .join (cache_directory , "bakefiles" , foam_velocity_filename )
2015
+ filedata = fluidsim .get_whitewater_foam_velocity_attribute_data ()
2016
+ with open (foam_velocity_filepath , 'wb' ) as f :
2017
+ f .write (filedata )
2018
+
2019
+ bubble_velocity_filename = "velocitybubble" + fstring + ".wwp"
2020
+ bubble_velocity_filepath = os .path .join (cache_directory , "bakefiles" , bubble_velocity_filename )
2021
+ filedata = fluidsim .get_whitewater_bubble_velocity_attribute_data ()
2022
+ with open (bubble_velocity_filepath , 'wb' ) as f :
2023
+ f .write (filedata )
2024
+
2025
+ spray_velocity_filename = "velocityspray" + fstring + ".wwp"
2026
+ spray_velocity_filepath = os .path .join (cache_directory , "bakefiles" , spray_velocity_filename )
2027
+ filedata = fluidsim .get_whitewater_spray_velocity_attribute_data ()
2028
+ with open (spray_velocity_filepath , 'wb' ) as f :
2029
+ f .write (filedata )
2030
+
2031
+ dust_velocity_filename = "velocitydust" + fstring + ".wwp"
2032
+ dust_velocity_filepath = os .path .join (cache_directory , "bakefiles" , dust_velocity_filename )
2033
+ filedata = fluidsim .get_whitewater_dust_velocity_attribute_data ()
2034
+ with open (dust_velocity_filepath , 'wb' ) as f :
2035
+ f .write (filedata )
2036
+
2037
+ if fluidsim .enable_whitewater_id_attribute :
2038
+ foam_id_filename = "idfoam" + fstring + ".wwi"
2039
+ foam_id_filepath = os .path .join (cache_directory , "bakefiles" , foam_id_filename )
2040
+ filedata = fluidsim .get_whitewater_foam_id_attribute_data ()
2041
+ with open (foam_id_filepath , 'wb' ) as f :
2042
+ f .write (filedata )
2043
+
2044
+ bubble_id_filename = "idbubble" + fstring + ".wwi"
2045
+ bubble_id_filepath = os .path .join (cache_directory , "bakefiles" , bubble_id_filename )
2046
+ filedata = fluidsim .get_whitewater_bubble_id_attribute_data ()
2047
+ with open (bubble_id_filepath , 'wb' ) as f :
2048
+ f .write (filedata )
2049
+
2050
+ spray_id_filename = "idspray" + fstring + ".wwi"
2051
+ spray_id_filepath = os .path .join (cache_directory , "bakefiles" , spray_id_filename )
2052
+ filedata = fluidsim .get_whitewater_spray_id_attribute_data ()
2053
+ with open (spray_id_filepath , 'wb' ) as f :
2054
+ f .write (filedata )
2055
+
2056
+ dust_id_filename = "iddust" + fstring + ".wwi"
2057
+ dust_id_filepath = os .path .join (cache_directory , "bakefiles" , dust_id_filename )
2058
+ filedata = fluidsim .get_whitewater_dust_id_attribute_data ()
2059
+ with open (dust_id_filepath , 'wb' ) as f :
2060
+ f .write (filedata )
2061
+
2062
+ if fluidsim .enable_whitewater_lifetime_attribute :
2063
+ foam_lifetime_filename = "lifetimefoam" + fstring + ".wwf"
2064
+ foam_lifetime_filepath = os .path .join (cache_directory , "bakefiles" , foam_lifetime_filename )
2065
+ filedata = fluidsim .get_whitewater_foam_lifetime_attribute_data ()
2066
+ with open (foam_lifetime_filepath , 'wb' ) as f :
2067
+ f .write (filedata )
2068
+
2069
+ bubble_lifetime_filename = "lifetimebubble" + fstring + ".wwf"
2070
+ bubble_lifetime_filepath = os .path .join (cache_directory , "bakefiles" , bubble_lifetime_filename )
2071
+ filedata = fluidsim .get_whitewater_bubble_lifetime_attribute_data ()
2072
+ with open (bubble_lifetime_filepath , 'wb' ) as f :
2073
+ f .write (filedata )
2074
+
2075
+ spray_lifetime_filename = "lifetimespray" + fstring + ".wwf"
2076
+ spray_lifetime_filepath = os .path .join (cache_directory , "bakefiles" , spray_lifetime_filename )
2077
+ filedata = fluidsim .get_whitewater_spray_lifetime_attribute_data ()
2078
+ with open (spray_lifetime_filepath , 'wb' ) as f :
2079
+ f .write (filedata )
2080
+
2081
+ dust_lifetime_filename = "lifetimedust" + fstring + ".wwf"
2082
+ dust_lifetime_filepath = os .path .join (cache_directory , "bakefiles" , dust_lifetime_filename )
2083
+ filedata = fluidsim .get_whitewater_dust_lifetime_attribute_data ()
2084
+ with open (dust_lifetime_filepath , 'wb' ) as f :
2085
+ f .write (filedata )
2086
+
1994
2087
1995
2088
def __write_fluid_particle_data (cache_directory , fluidsim , frameno ):
1996
2089
fstring = __frame_number_to_string (frameno )
@@ -2064,6 +2157,7 @@ def __get_frame_stats_dict(cstats):
2064
2157
stats ["surfaceblur" ] = __get_mesh_stats_dict (cstats .surfaceblur )
2065
2158
stats ["surfacevelocity" ] = __get_mesh_stats_dict (cstats .surfacevelocity )
2066
2159
stats ["surfacespeed" ] = __get_mesh_stats_dict (cstats .surfacespeed )
2160
+ stats ["surfacevorticity" ] = __get_mesh_stats_dict (cstats .surfacevorticity )
2067
2161
stats ["surfaceage" ] = __get_mesh_stats_dict (cstats .surfaceage )
2068
2162
stats ["surfacecolor" ] = __get_mesh_stats_dict (cstats .surfacecolor )
2069
2163
stats ["surfacesourceid" ] = __get_mesh_stats_dict (cstats .surfacesourceid )
@@ -2075,6 +2169,18 @@ def __get_frame_stats_dict(cstats):
2075
2169
stats ["bubbleblur" ] = __get_mesh_stats_dict (cstats .bubbleblur )
2076
2170
stats ["sprayblur" ] = __get_mesh_stats_dict (cstats .sprayblur )
2077
2171
stats ["dustblur" ] = __get_mesh_stats_dict (cstats .dustblur )
2172
+ stats ["foamvelocity" ] = __get_mesh_stats_dict (cstats .foamvelocity )
2173
+ stats ["bubblevelocity" ] = __get_mesh_stats_dict (cstats .bubblevelocity )
2174
+ stats ["sprayvelocity" ] = __get_mesh_stats_dict (cstats .sprayvelocity )
2175
+ stats ["dustvelocity" ] = __get_mesh_stats_dict (cstats .dustvelocity )
2176
+ stats ["foamid" ] = __get_mesh_stats_dict (cstats .foamid )
2177
+ stats ["bubbleid" ] = __get_mesh_stats_dict (cstats .bubbleid )
2178
+ stats ["sprayid" ] = __get_mesh_stats_dict (cstats .sprayid )
2179
+ stats ["dustid" ] = __get_mesh_stats_dict (cstats .dustid )
2180
+ stats ["foamlifetime" ] = __get_mesh_stats_dict (cstats .foamlifetime )
2181
+ stats ["bubblelifetime" ] = __get_mesh_stats_dict (cstats .bubblelifetime )
2182
+ stats ["spraylifetime" ] = __get_mesh_stats_dict (cstats .spraylifetime )
2183
+ stats ["dustlifetime" ] = __get_mesh_stats_dict (cstats .dustlifetime )
2078
2184
stats ["particles" ] = __get_mesh_stats_dict (cstats .particles )
2079
2185
stats ["obstacle" ] = __get_mesh_stats_dict (cstats .obstacle )
2080
2186
stats ["timing" ] = __get_timing_stats_dict (cstats .timing )
@@ -2397,7 +2503,9 @@ def set_console_output(boolval):
2397
2503
2398
2504
2399
2505
def __get_addon_version ():
2400
- module = sys .modules ["flip_fluids_addon" ]
2506
+ module_dir = os .path .dirname (os .path .realpath (__file__ ))
2507
+ module_name = os .path .basename (os .path .normpath (module_dir ))
2508
+ module = sys .modules [module_name ]
2401
2509
addon_major , addon_minor , addon_revision = module .bl_info .get ('version' , (- 1 , - 1 , - 1 ))
2402
2510
return str (addon_major ) + "." + str (addon_minor ) + "." + str (addon_revision )
2403
2511
0 commit comments