Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 41

Thread: Macros recorder

  1. #21
    Thanks,
    I got it
    (I thought it's a simple tool just to do what Photoshop action recorder does.)
    Very helpful tool anyway



  2. #22
    Nice tool. Until Blender logs all the parameters needed for (re)execution of ops its only usable for simple things. I tried to model a simple vase with macro recording on, but only a subset of commands was recorded and only few had all the needed parameters.

    Its a real shame. Would be nice for repetitive tasks.



  3. #23
    Member
    Join Date
    Apr 2008
    Posts
    222
    The recorder instals OK but it doesn't seem to create macros that work. Here's a simple move to the default cube' Help please?




    import bpy
    from mathutils import Vector, Matrix, Quaternion, Euler, Color

    class MacroOperator(bpy.types.Operator):
    bl_idname = "macro.macro"
    bl_label = "Macro"

    def execute(self, context):
    bpy.ops.transform.translate(proportional='DISABLED ', snap_point=Vector((0.0, 0.0, 0.0)), constraint_orientation='GLOBAL', proportional_edit_falloff='SMOOTH', release_confirm=False, snap_normal=Vector((0.0, 0.0, 0.0)), texture_space=False, snap_align=False, snap=False, remove_on_cancel=False, mirror=False, constraint_axis=(False, False, False), snap_target='CLOSEST', gpencil_strokes=False, value=Vector((1.1576882600784302, 3.401761770248413, 0.6333605647087097)), proportional_size=1.0)
    return {'FINISHED'}

    def register():
    bpy.utils.register_module(__name__)

    def unregister():
    bpy.utils.unregister_module(__name__)

    if __name__ == "__main__":
    register()



  4. #24
    Hm, how did you try to run the macro? Also, are you familiar with Blender scripting?

    Here's how to use the code you posted:
    1. Paste the code into a Blender's Text Editor area.
    2. Run the code (by pressing Alt+P or the "Run Script" button). This will register the class MacroOperator as an operator.
    3. Now you can actually invoke the operator by searching for the one with "macro" in its title.

    Alternatively, you can modify the code to immediately invoke the operator after its registration. In this case, add bpy.ops.macro.macro() at the end of the script.



  5. #25
    Member
    Join Date
    Apr 2008
    Posts
    222
    Thank you for your reply. I just did a "Run Script". I'm certainly no scripting expert.

    I did get it to work with a simple cut and paste, adding the 2 lines at the start, deleting a line that caused a fail ( bpy.data.window_managers["WinMan"].(null)[1] = True ), and adding the last line. Why would the WinMan line fail when it is what is created?

    import bpy
    from mathutils import Vector, Matrix, Quaternion, Euler, Color
    bpy.ops.transform.translate(value=(0.864864, 3.01713, 0.859181), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
    bpy.ops.object.move_to_layer(layers=(False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
    bpy.context.scene.layers[1] = True
    bpy.context.scene.layers[0] = False



  6. #26
    Well, first of all, .(null) is not a valid Python syntax. I'm curious -- where did the line
    bpy.data.window_managers["WinMan"].(null)[1] = True
    came from? The macro recorder addon shouldn't be capable of writing such lines. Did you, by chance, copy it from the Info log?



  7. #27
    Member
    Join Date
    Apr 2008
    Posts
    222
    Yes, copied fromthe info log. How can it list invalid code?



  8. #28
    Member
    Join Date
    Apr 2008
    Posts
    222
    The macro recorder seems to record better than the info log (ie it doesn't use invalid commands) but the only way I can get it to run is by deleting the 'execute' and 'register' commands then hitting 'Run script'.



  9. #29
    How can it list invalid code?
    The "code" written to the info log seems to be computed (using simple string concatenation) from the parameters of internal operations that Blender executes. In some corner cases it doesn't result in a valid code -- for example, when a property was somehow deleted or has a weird name (e.g. actually named "(null)").
    Sometimes syntax-invalid property names can be intentional; I, for one, use them in cases where I resort to hacky methods.

    The macro recorder seems to record better than the info log (ie it doesn't use invalid commands) but the only way I can get it to run is by deleting the 'execute' and 'register' commands then hitting 'Run script'.
    I've made a note to myself to add an option for recording simple scripts (without wrapping the commands in an operator template). I'm not sure when I will get to implement it, though, since I'm kinda busy with other projects right now.



  10. #30
    Member
    Join Date
    Apr 2008
    Posts
    222
    Thank you dairin.
    A couple more problems. The recorder doesn't save 'duplicate' operations (but the info log does).
    'from bpy import context' must be added to the recorder output.



  11. #31
    Originally Posted by adb View Post
    The recorder doesn't save 'duplicate' operations (but the info log does).
    What exactly do you mean by "duplicate" operations? Can you provide a specific example?
    Just in case it might be relevant, please keep in mind that each time the macro recorder detects that an Undo operation took place, it will remove the last recorded operation from the record.

    Okay, I've added an option to record simple scripts ("Record Macro as script" in the Text menu of Text Editor). Try the latest version.



  12. #32
    Member
    Join Date
    Apr 2008
    Posts
    222
    Originally Posted by dairin0d View Post
    What exactly do you mean by "duplicate" operations?
    Shift + D. Strangely I tried it on a different PC and it worked fine.



  13. #33
    Member
    Join Date
    Apr 2008
    Posts
    222
    It also doesn't copy 'Track To' 'Copy Location' etc parameters either. Even the info log misses some things.
    I eventually cobbled my macros together though.



  14. #34
    It seems not all operators were designed with macro-recording in mind (technically it's a bug, I suppose).



  15. #35
    I have just record the macro with extrude on a default cube. Im using 2.79 and the addon from here https://raw.githubusercontent.com/da...os_recorder.py
    I have recorded the macro but its not working may i know how it works and why its not working. Any suggestion or is there any video regarding the addon. http://pasteall.org/pic/index.php?id=119407
    Can you plz tell me in detail how it works. Thanks



  16. #36
    Huh. Weird. When I try to do the same, I get a recorded sequence of operators. Does Blender print any errors to the console (Window->Toggle System Console)?
    What extra addons do you have enabled (besides the ones that are enabled by default in a fresh Blender install)?



  17. #37
    There is no error message. And i have many additional addon enable. Can u plz make a video or gif file so that i understand how it works and whats going wrong and why i cant record.



  18. #38
    Here is how it works for me: http://pasteall.org/pic/index.php?id=119426
    Can you try to disable your additional addons to see if they are somehow interfering with the recording process?



  19. #39
    As shown i have done it not recorded or no script written in the text editor but on the top its created the script do i have to copy that text and paste in the script or it record automatically. This is what i have tried uptill know http://pasteall.org/pic/index.php?id=119432. After the script written above do i have to copy and paste and then it will generated what i have recorded below the extrude and intersect etc.



  20. #40
    Well... I have no idea why the addon doesn't work for you. Just don't use it and copy-paste the text from the top directly, I guess.
    Either way, you need to be familiar with blender scripting to make the recorded sequence of operators actually work as you intended.



Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •