====== Differences ====== This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
doc_opener [2015/08/20 11:56] swann [c. custompath operator] |
doc_opener [2015/08/20 12:07] (current) swann [c. custompath operator] |
||
|---|---|---|---|
| Line 202: | Line 202: | ||
| </code> | </code> | ||
| - | <code python> | + | Ici il s'agit du corps de l'opérateur, la fonction execute va s'éxecuter à chaque appel de l'opérateur. Il en est de même ,pour les fonctions draw et invoke. |
| + | <code python> | ||
| def execute(self, context): | def execute(self, context): | ||
| - | set the string path fo the file here. | + | #ajout du chemin sélectionné |
| - | #this is a variable created from the top to start it | + | ressources.Items.append((str(self.properties.filepath),str(self.properties.filepath),"")) |
| - | #bpy.context.scene.newF = self.properties.filepath | + | #Création du tuple temporaire |
| + | t=(str(self.properties.filepath),str(self.properties.filepath))) | ||
| + | #Mise à jour de la liste des dossier racine | ||
| + | interface.UpdateEnum(bpy.types.Scene,ressources.Items,'Store',t) | ||
| | | ||
| - | print("*************SELECTED FILES ***********") | + | #Sauvegarde du dossier sélectionné de manière persistante |
| - | for file in self.files: | + | |
| - | print("FILEPATH %s"%self.properties.filepath)#display the file name and current path | + | |
| - | ressources.Items.append((str(self.properties.filepath),str(self.properties.filepath),"")) | + | |
| - | interface.UpdateEnum(bpy.types.Scene,ressources.Items,'Store',str(self.properties.filepath),str(self.properties.filepath)) | + | |
| - | + | ||
| - | #Sauvegarde du dossier séléctionné de manière persistente | + | |
| persistence.write_config() | persistence.write_config() | ||
| + | #Find de fonction | ||
| return {'FINISHED'} | return {'FINISHED'} | ||
| + | |||
| + | #Fonction d'affichage de l'explorateur de fichier | ||
| def draw(self, context): | def draw(self, context): | ||
| self.layout.operator('file.select_all_toggle') | self.layout.operator('file.select_all_toggle') | ||