File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -3138,17 +3138,18 @@ 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'
3141
+ def capture (self , filename , capture_labels = None ):
3142
+ if not isinstance (filename , str ):
3143
+ raise TypeError ("'filename' for Capture must be a string." )
3144
+
3145
+ if filename [- 4 :] != ".png" :
3146
+ filename += ".png"
3147
+
3147
3148
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 )
3149
+ if capture_labels is not None :
3150
+ include_labels = "T" if capture_labels else "F "
3151
+
3152
+ self .addmethod (" capture" , include_labels + filename )
3152
3153
3153
3154
@property
3154
3155
def objects (self ):
You can’t perform that action at this time.
0 commit comments