@@ -132,46 +132,48 @@ def run(self):
132132 time .sleep (0.5 )
133133
134134 # Build command list to avoid semicolon issues in netcon
135+ t = 0.1 # Tick interval
135136 cmds = [
136137 "sv_cheats 1" , "noclip 1" , "r_drawviewmodel 0" , "cl_drawhud 0" , "r_drawpanorama 0" , "cl_firstperson_legs 0" ,
137138 "fov_cs_debug 106.260205" , "ent_fire cmd kill" , "ent_create point_servercommand {targetname cmd}" ,
138139 "screenshot_subdir screenshots\\ \\ cubemap" ,
139140 'ent_fire worldent addoutput "OnUser1>cmd>command>r_always_render_all_windows true>0.01>1"' ,
140141 # Forward
141- f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 1 * 0.5 } >1"' ,
142- f'ent_fire worldent addoutput "OnUser1>cmd>command>setang 0 0 0>{ 1 * 0.5 } >1"' ,
143- f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _forward>{ 1 * 0.5 + 0.1 } >1"' ,
144- f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 1 * 0.5 + 0.2 } >1"' ,
142+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 1 * t } >1"' ,
143+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setang_exact 1 0 0>{ 1 * t } >1"' ,
144+ f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _forward>{ 1 * t + 0.01 } >1"' ,
145+ f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 1 * t + 0.02 } >1"' ,
145146 # Right
146- f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 2 * 0.5 } >1"' ,
147- f'ent_fire worldent addoutput "OnUser1>cmd>command>setang 0 270 0 >{ 2 * 0.5 } >1"' ,
148- f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _right>{ 2 * 0.5 + 0.1 } >1"' ,
149- f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 2 * 0.5 + 0.2 } >1"' ,
147+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 2 * t } >1"' ,
148+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setang_exact 0 270 -1 >{ 2 * t } >1"' ,
149+ f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _right>{ 2 * t + 0.01 } >1"' ,
150+ f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 2 * t + 0.02 } >1"' ,
150151 # Back
151- f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 3 * 0.5 } >1"' ,
152- f'ent_fire worldent addoutput "OnUser1>cmd>command>setang 0 180 0>{ 3 * 0.5 } >1"' ,
153- f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _back>{ 3 * 0.5 + 0.1 } >1"' ,
154- f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 3 * 0.5 + 0.2 } >1"' ,
152+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 3 * t } >1"' ,
153+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setang_exact -1 180 0>{ 3 * t } >1"' ,
154+ f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _back>{ 3 * t + 0.01 } >1"' ,
155+ f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 3 * t + 0.02 } >1"' ,
155156 # Left
156- f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 4 * 0.5 } >1"' ,
157- f'ent_fire worldent addoutput "OnUser1>cmd>command>setang 0 90 0 >{ 4 * 0.5 } >1"' ,
158- f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _left>{ 4 * 0.5 + 0.1 } >1"' ,
159- f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 4 * 0.5 + 0.2 } >1"' ,
157+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 4 * t } >1"' ,
158+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setang_exact 0 90 1 >{ 4 * t } >1"' ,
159+ f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _left>{ 4 * t + 0.01 } >1"' ,
160+ f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 4 * t + 0.02 } >1"' ,
160161 # Up
161- f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 5 * 0.5 } >1"' ,
162- f'ent_fire worldent addoutput "OnUser1>cmd>command>setang -90 0 0>{ 5 * 0.5 } >1"' ,
163- f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _up>{ 5 * 0.5 + 0.1 } >1"' ,
164- f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 5 * 0.5 + 0.2 } >1"' ,
162+ f'ent_fire worldent addoutput "OnUser1>cmd>command>fov_cs_debug 106.260205>{ 5 * t } >1"' ,
163+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 5 * t } >1"' ,
164+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setang_exact -89 0 0>{ 5 * t } >1"' ,
165+ f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _up>{ 5 * t + 0.01 } >1"' ,
166+ f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 5 * t + 0.02 } >1"' ,
165167 # Down
166- f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 6 * 0.5 } >1"' ,
167- f'ent_fire worldent addoutput "OnUser1>cmd>command>setang 90 0 0 >{ 6 * 0.5 } >1"' ,
168- f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _down>{ 6 * 0.5 + 0.1 } >1"' ,
169- f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 6 * 0.5 + 0.2 } >1"' ,
168+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setpos_exact { x } { y } { z } >{ 6 * t } >1"' ,
169+ f'ent_fire worldent addoutput "OnUser1>cmd>command>setang_exact 89 180 180 >{ 6 * t } >1"' ,
170+ f'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_prefix { session_id } _cube_{ ev_suffix } _down>{ 6 * t + 0.01 } >1"' ,
171+ f'ent_fire worldent addoutput "OnUser1>cmd>command>png_screenshot>{ 6 * t + 0.02 } >1"' ,
170172 # Cleanup
171- f'ent_fire worldent addoutput "OnUser1>cmd>command>cl_drawhud 1;r_drawviewmodel 1;r_drawpanorama 1;cl_firstperson_legs 1;fov_cs_debug 0;noclip 0>4.0 >1"' ,
172- f'ent_fire worldent addoutput "OnUser1>cmd>command>r_always_render_all_windows { original_render_all } >4.2 >1"' ,
173- 'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_subdir \" \" >4.2 >1"' ,
174- 'ent_fire worldent addoutput "OnUser1>cmd>command>echo [Cubemap Done]>4.5 >1"'
173+ f'ent_fire worldent addoutput "OnUser1>cmd>command>cl_drawhud 1;r_drawviewmodel 1;r_drawpanorama 1;cl_firstperson_legs 1;fov_cs_debug 0;noclip 1> { 7 * t } >1"' ,
174+ f'ent_fire worldent addoutput "OnUser1>cmd>command>r_always_render_all_windows { original_render_all } >{ 7 * t + 0.1 } >1"' ,
175+ f 'ent_fire worldent addoutput "OnUser1>cmd>command>screenshot_subdir \" \" >{ 7 * t + 0.1 } >1"' ,
176+ 'ent_fire worldent addoutput "OnUser1>cmd>command>echo [Cubemap Done]>5.0 >1"'
175177 ]
176178
177179 CS2Netcon .send_many (cmds ) # Send all setup commands including the sentinel echo
@@ -202,28 +204,24 @@ def run(self):
202204
203205 if self .config ['mode' ] == "CrossHLayout" :
204206 stitcher .stitch_cross (faces , output_path )
207+ elif self .config ['mode' ] == "Individual Faces" :
208+ # Save individual faces to a subfolder
209+ indiv_dir = os .path .join (self .config ['out' ], f"individual_{ ev_suffix } " )
210+ os .makedirs (indiv_dir , exist_ok = True )
211+ face_names = ["forward" , "right" , "back" , "left" , "up" , "down" ]
212+ for i , name in enumerate (face_names ):
213+ face_img = Image .fromarray (faces [i ])
214+ face_img .save (os .path .join (indiv_dir , f"{ name } .png" ))
215+ self .progress .emit (f"Saved individual faces to { indiv_dir } " )
205216 else :
206217 stitcher .stitch_equirectangular (faces , output_path )
207218
208219 except Exception as e :
209220 self .error .emit (f"Error stitching EV { ev } : { e } " )
210221 return
211222
212- self .finished .emit (f"Success! Cubemap saved to: { self .config ['out' ]} " )
213-
214- # Ensure output folder exists
215- os .makedirs (self .config ['out' ], exist_ok = True )
216-
217- out_name = "output_cubemap"
218- if self .config ['mode' ] == "CrossHLayout" :
219- out_path = os .path .join (self .config ['out' ], f"{ out_name } .exr" )
220- stitcher .stitch_cross (faces , out_path )
221- else :
222- out_path = os .path .join (self .config ['out' ], f"{ out_name } .jpg" )
223- stitcher .stitch_equirectangular (faces , out_path )
224-
225223 # Success cleanup
226224 try : shutil .rmtree (cs2_ss_dir )
227225 except : pass
228226
229- self .finished .emit (f"Success! Output saved to: { out_path } " )
227+ self .finished .emit (f"Success! Cubemap saved to: { self . config [ 'out' ] } " )
0 commit comments