File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -3138,17 +3138,15 @@ def pixel_to_world(self):
3138
3138
def pixel_to_world (self , value ):
3139
3139
raise AttributeError ('pixel_to_world is read-only' )
3140
3140
3141
- def capture (self , * s ):
3142
- if len (s ) == 0 :
3143
- raise AttributeError ('scene.capture requires at least one argument.' )
3144
- filename = s [0 ]
3145
- if not isinstance (filename , str ): raise AttributeError ('A capture file name must be a string.' )
3146
- if '.png' not in filename : filename += '.png'
3147
- include_labels = "T"
3148
- if len (s ) == 2 :
3149
- if s [1 ] == True : include_labels = "T"
3150
- else : include_labels = "F"
3151
- self .addmethod ('capture' , include_labels + filename )
3141
+ def capture (self , filename , capture_labels = True ):
3142
+ if not isinstance (filename , str ):
3143
+ raise TypeError ("'filename' for Capture must be a string." )
3144
+
3145
+ if filename .endswith (".png" ):
3146
+ filename += ".png"
3147
+
3148
+ include_labels = "T" if capture_labels else "F"
3149
+ self .addmethod ("capture" , include_labels + filename )
3152
3150
3153
3151
@property
3154
3152
def objects (self ):
You can’t perform that action at this time.
0 commit comments