forked from bartvdbraak/blender
03806d0b67
This commit implements described in the #104573. The goal is to fix the confusion of the submodule hashes change, which are not ideal for any of the supported git-module configuration (they are either always visible causing confusion, or silently staged and committed, also causing confusion). This commit replaces submodules with a checkout of addons and addons_contrib, covered by the .gitignore, and locale and developer tools are moved to the main repository. This also changes the paths: - /release/scripts are moved to the /scripts - /source/tools are moved to the /tools - /release/datafiles/locale is moved to /locale This is done to avoid conflicts when using bisect, and also allow buildbot to automatically "recover" wgen building older or newer branches/patches. Running `make update` will initialize the local checkout to the changed repository configuration. Another aspect of the change is that the make update will support Github style of remote organization (origin remote pointing to thy fork, upstream remote pointing to the upstream blender/blender.git). Pull Request #104755
43 lines
963 B
Python
43 lines
963 B
Python
import bpy
|
|
|
|
|
|
def main(context):
|
|
for ob in context.scene.objects:
|
|
print(ob)
|
|
|
|
|
|
class SimpleOperator(bpy.types.Operator):
|
|
"""Tooltip"""
|
|
bl_idname = "object.simple_operator"
|
|
bl_label = "Simple Object Operator"
|
|
|
|
@classmethod
|
|
def poll(cls, context):
|
|
return context.active_object is not None
|
|
|
|
def execute(self, context):
|
|
main(context)
|
|
return {'FINISHED'}
|
|
|
|
|
|
def menu_func(self, context):
|
|
self.layout.operator(SimpleOperator.bl_idname, text=SimpleOperator.bl_label)
|
|
|
|
|
|
# Register and add to the "object" menu (required to also use F3 search "Simple Object Operator" for quick access).
|
|
def register():
|
|
bpy.utils.register_class(SimpleOperator)
|
|
bpy.types.VIEW3D_MT_object.append(menu_func)
|
|
|
|
|
|
def unregister():
|
|
bpy.utils.unregister_class(SimpleOperator)
|
|
bpy.types.VIEW3D_MT_object.remove(menu_func)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
register()
|
|
|
|
# test call
|
|
bpy.ops.object.simple_operator()
|