[Bf-extensions-cvs] [7a4dbb33] master: Port to 2.8. cleanup: unused code.

vlassius santos noreply at git.blender.org
Tue Jan 22 00:31:20 CET 2019


Commit: 7a4dbb3305b13c588032930d541e2a23d0c0a780
Author: vlassius santos
Date:   Mon Jan 21 21:30:10 2019 -0200
Branches: master
https://developer.blender.org/rBAC7a4dbb3305b13c588032930d541e2a23d0c0a780

Port to 2.8. cleanup: unused code.

===================================================================

M	io_import_sound_to_anim.py

===================================================================

diff --git a/io_import_sound_to_anim.py b/io_import_sound_to_anim.py
index 0775df8a..f2b018fc 100644
--- a/io_import_sound_to_anim.py
+++ b/io_import_sound_to_anim.py
@@ -21,9 +21,9 @@
 bl_info = {
     "name": "Import: Sound to Animation",
     "author": "Vlassius",
-    "version": (0, 70),
-    "blender": (2, 64, 0),
-    "location": "Select a object > Object tab > Import Movement From Wav File",
+    "version": (0, 80),
+    "blender": (2, 80, 0),
+    "location": "Select a object > View3D > Tool Shelf > Import Movement From .Wav File",
     "description": "Extract movement from sound file. "
         "See the Object Panel at the end.",
     "warning": "",
@@ -41,103 +41,11 @@ bl_info = {
 - At least Blender 2.64.9 is necessary to run this program.
 - Curitiba - Brasil
 
-
--v 0.70Beta-
-    Included: SmartRender - Render just the frames that has changes
-    Included: Options to check SmartRender for Blender Internal Render Engine:LocRotScale, Material, Transp, Mirror
-    Included: User can Cancel all functions with CANCEL button- Extensive Code and flux change (bugs expected)
-    Included: User can Cancel all functions with ESC
-    Inclused: User friendly messages into UI while running (its no more necessary to look at terminal window to most users)
-    Cleanup:  Non Stardard Chars in coments
-    To Do:    Decrease overhead of timer loops
-    To Do:    Try to implement Smart Render for Cycles
-
--v 0.60Beta-
-    Included: Option to use just the beat from the audio sound
-    Included: Option to exclude the beat from the audio sound
-    Included: More or less sensibility options when using the beat
-    Included: Audio Channel Select option
-
--v 0.50Beta-
-    Included: Auto Adjust Audio Sensity option
-    Included: 8 bits .wav file support
-    Recalibrated: Manual audio sense 1
-    Cosmetic: Many changes in panel and terminal window info
-    Corrected: Tracker_url
-    Corrected: a few bytes in Memory Leaks
-    work around: memory leak in function: bpy.ops.transform.rotate
-    work around: memory leak in function: bpy.ops.anim.keyframe_insert
-
--v 0.22Beta-
-    Included:
-    Camera Rotation
-    Empty Location-Rotation-Scale
-
--v 0.21Beta-
-    Changed just the meta informations like version and wiki page.
-
--v 0.20 Beta-
-    New Panel
-
--v 0.1.5 Beta-
-    Change in API-> Properties
-    Included the button "Get FPS from Scene" due to a problem to get it in the start
-    Return to Frame 1 after import
-    Filter .wav type file (by batFINGER)
-
--v 0.1.4 Beta-
-    If choose negative in rotation, auto check the rotation negative to Bones
-    change in register()  unregister():
-
--v 0.1.3 Beta-
-    File Cleanup
-    Change to bl_info.
-    Cosmetic Changes.
-    Minor change in API in how to define buttons.
-    Adjust in otimization.
-
--v 0.1.2 Beta
-change in API- Update function bpy.ops.anim.keyframe_insert_menu
-
--v 0.1.1 Beta
-change in API- Update property of  window_manager.fileselect_add
-
--v 0.1.0 Beta
-new - Added support to LAMP object
-new - improved flow to import
-new - check the type of object before show options
-bug - option max. and min. values
-change- Updated scene properties for changes in property API.
-        See http://lists.blender.org/pipermail/bf-committers/2010-September/028654.html
-new flow: 1) Process the sound file    2) Show Button to import key frames
-
-- v0.0.4 ALPHA
-new - Added destructive optimizer option - LostLestSignificativeDigit lost/total -> 10/255 default
-new - Visual Graph to samples
-new - Option to just process audio file and do not import - this is to help adjust the audio values
-new - Get and show automatically the FPS (in proper field) information taking the information from scene
-bug- Display sensitivity +1
-bug - Corrected location of the script in description
-
-- v0.0.3
-Main change: Corrected to work INSIDE dir /install/linux2/2.53/scripts/addons
-Corrected position of label "Rotation Negative"
-Added correct way to deal with paths in Python os.path.join - os.path.normpath
-
-- v0.0.2
-Corrected initial error (Register() function)
-Corrected some labels R. S. L.
-Turned off "object field" for now
-Changed target default to Z location
-
-- v0.0.1
-Initial version
-
 Credit to:
 Vlassius
 
 - http://vlassius.com.br
-- vlassius at vlassius.com.br
+- vlassius at vlassius.eng.br
 - Curitiba - Brasil
 
 """
@@ -154,20 +62,29 @@ def _Interna_Globals(BytesDadosTotProcess, context):
 
     array= bytearray(BytesDadosTotProcess)  # cria array
     arrayAutoSense= bytearray((BytesDadosTotProcess)*2)  # cria array para AutoAudioSense
-    context.scene.imp_sound_to_anim.bArrayCriado=True
+    context.object.imp_sound_to_anim.bArrayCriado=True
 
 #
 #==================================================================================================
 # BLENDER UI Panel
 #==================================================================================================
 #
-class VIEW3D_PT_CustomMenuPanel(bpy.types.Panel):
+"""class VIEW3D_PT_CustomMenuPanel(bpy.types.Panel):
     bl_space_type = "PROPERTIES"
     bl_region_type = "WINDOW"
     bl_context = "object"
     bl_label = "Import Movement From Wav File"
+    bl_options = {'DEFAULT_CLOSED'}"""
+    
+class VIEW3D_PT_CustomMenuPanel(bpy.types.Panel):
+    bl_idname = "IMPORTWAVTOOL_PT_tools"
+    bl_space_type = "VIEW_3D"
+    bl_context = "objectmode"
+    bl_region_type = "UI"
+    bl_label = "Import Tool"
+    bl_category = "Import Movement From Wav File"
     bl_options = {'DEFAULT_CLOSED'}
-
+    
     def draw(self, context):
         layout = self.layout
 
@@ -183,53 +100,53 @@ class VIEW3D_PT_CustomMenuPanel(bpy.types.Panel):
             row.label(text="Supported Object are Type: Armature, Mesh, Camera and Lamp")
             row=layout.row()
         else:
-            #print(context.scene.imp_sound_to_anim.bTypeImport)
-            if context.scene.imp_sound_to_anim.bTypeImport == 0:
+            #print(context.object.imp_sound_to_anim.bTypeImport)
+            if context.object.imp_sound_to_anim.bTypeImport == 0:
                 #mount panel to Direct animation
                 row=layout.row()
                 layout.operator("import.sound_animation_botao_udirect")
 
             # monta as telas quando está rodando
-            elif context.scene.imp_sound_to_anim.Working!="":   #its running
+            elif context.object.imp_sound_to_anim.Working!="":   #its running
                 row=layout.row()
                 row=layout.row()
 
-                if context.scene.imp_sound_to_anim.Working== "CheckSmartRender":
-                    #context.scene.imp_sound_to_anim.Info_check_smartrender=
+                if context.object.imp_sound_to_anim.Working== "CheckSmartRender":
+                    #context.object.imp_sound_to_anim.Info_check_smartrender=
                     row=layout.row()
                     row.label(text="Checking for Smart Render...")
                     row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_check_smartrender)
+                    row.label(text=context.object.imp_sound_to_anim.Info_check_smartrender)
                     row=layout.row()
 
-                elif context.scene.imp_sound_to_anim.Working== "SmartRender":
-                    #context.scene.imp_sound_to_anim.Info_check_smartrender=
+                elif context.object.imp_sound_to_anim.Working== "SmartRender":
+                    #context.object.imp_sound_to_anim.Info_check_smartrender=
                     row=layout.row()
                     row.label(text="Processing Smart Render...")
                     row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_check_smartrender)
+                    row.label(text=context.object.imp_sound_to_anim.Info_check_smartrender)
                     row=layout.row()
 
-                elif context.scene.imp_sound_to_anim.Working== "ProcessaSom":
-                    #context.scene.imp_sound_to_anim.Info_Import=
+                elif context.object.imp_sound_to_anim.Working== "ProcessaSom":
+                    #context.object.imp_sound_to_anim.Info_Import=
                     row=layout.row()
                     row.label(text="Processing Sound File...")
                     row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_Import)
+                    row.label(text=context.object.imp_sound_to_anim.Info_Import)
 
-                elif context.scene.imp_sound_to_anim.Working== "wavimport":
-                    #context.scene.imp_sound_to_anim.Info_Import=
+                elif context.object.imp_sound_to_anim.Working== "wavimport":
+                    #context.object.imp_sound_to_anim.Info_Import=
                     row=layout.row()
                     row.label(text="Importing Keys...")
                     row=layout.row()
-                    row.label(text=context.scene.imp_sound_to_anim.Info_Import)
+                    row.label(text=context.object.imp_sound_to_anim.Info_Import)
                     row=layout.row()
 
                 # botao cancel
                 layout.operator(OBJECT_OT_Botao_Cancel.bl_idname)
                 row=layout.row()
 
-            elif context.scene.imp_sound_to_anim.bTypeImport == 1:
+            elif context.object.imp_sound_to_anim.bTypeImport == 1:
                 row=layout.row()
                 row.label(text="1)Click button \"Process Wav\",")
                 row=layout.row()
@@ -237,80 +154,80 @@ class VIEW3D_PT_CustomMenuPanel(bpy.types.Panel):
                 row=layout.row()
                 row.label(text="Run the animation (alt A) and Enjoy!")
                 row=layout.row()
-                row.prop(context.scene.imp_sound_to_anim,"action_auto_audio_sense")
+                row.prop(context.object.imp_sound_to_anim,"action_auto_audio_sense")
                 row=layout.row()
-                if context.scene.imp_sound_to_anim.action_auto_audio_sense == 0:   # se auto audio sense desligado
-                    row.prop(context.scene.imp_sound_to_anim,"audio_sense")
+                if context.object.imp_sound_to_anim.action_auto_audio_sense == 0:   # se auto audio sense desligado
+ 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list