Skip to content
Dealga McArdle edited this page Apr 9, 2021 · 5 revisions

Macros are bits of code that you wish to execute often.

see this thread which covers more elaborate macros, as well as simple ones

image

Usage

  • ctrl+space will trigger a new search bar.

  • The search database is loaded with

    • All nodes (shows Node Name (bl_label) and Description

    • Several default macros ( shown by > )

    • (optionally) User Driven Macros ( shown by < ) These need to be created by the user in /datafiles/sverchok/user_macros/macros.py .

      to find where you should place these macros.py, run this from the TextEditor, and see what it prints

      import os
      import bpy
      datafiles = os.path.join(bpy.utils.user_resource('DATAFILES', path='sverchok', create=True))
      print(datafiles)

      output

      # ubuntu
      /home/username/.config/blender/2.78/datafiles/sverchok
      
      # windows
      C:\Users\username\AppData\Roaming\Blender Foundation\Blender\2.78\datafiles\sverchok
      
      macros.py
      """
      This file demonstrates a few features that can be used in a macro
      """
      
      def domo_esta(self, context):
          """ info about domo esta /// will ignore this"""
          active_node = context.active_node
          print('mouse:', context.space_data.cursor_location)
          if active_node:
              print(active_node.name)
              print(active_node.location)
              print(active_node.bl_idname)
      
      
      def domo_esta4(self, context, a=10, b=140):
          """ info about domo esta4 """
          print(a, b)

      That produces this when you type <

      image

Clone this wiki locally