Skip to content

Commit

Permalink
Migrate to extensions platform
Browse files Browse the repository at this point in the history
- Remove auto updater.
  • Loading branch information
mrachinskiy committed Jun 3, 2024
1 parent efb700d commit f0457ae
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 128 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ Features:
Video:

* [Demo v1.0](http://youtu.be/gLj4PvHbm4s)
* [Overview v1.4](https://youtu.be/YNtaR00sA40)
* [Tutorial: Simple Motiongraphics](http://youtu.be/qbJMTOUdxRY)


How to install
==========================

### Available as an [extension](https://extensions.blender.org/add-ons/commotion/) for Blender 4.2 or newer.

---

### For Blender 4.1 or older

1. Download [Commotion 2.3.1][download_latest]<sup>1</sup>
2. Make sure you have Blender 2.93 or newer.
3. Open `Preferences``Add-ons` category.
Expand All @@ -31,6 +35,12 @@ How to install
Установка
==========================

### Доступно как [расширение](https://extensions.blender.org/add-ons/commotion/) для Blender 4.2 или новее.

---

### Для Blender 4.1 или старше

1. Загрузите [Commotion 2.3.1][download_latest]<sup>1</sup>
2. Убедитесь, что у вас установлен Blender 2.93 или новее.
3. Откройте `Preferences``Add-ons`.
Expand Down
43 changes: 5 additions & 38 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,23 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

bl_info = {
"name": "Commotion",
"author": "Mikhail Rachinskiy",
"version": (2, 3, 1),
"blender": (2, 93, 0),
"location": "3D View > Sidebar",
"description": "Animation offset tools for motion graphics.",
"doc_url": "https://github.com/mrachinskiy/commotion#readme",
"tracker_url": "https://github.com/mrachinskiy/commotion/issues",
"category": "Animation",
}


if "bpy" in locals():
_essential.reload_recursive(var.ADDON_DIR, locals())
from pathlib import Path
from . import _essential
_essential.reload_recursive(Path(__file__).parent, locals())
else:
import bpy
from bpy.props import PointerProperty

from . import _essential, var

_essential.check(var.ADDON_DIR / "mod_update", bl_info["blender"])

from . import (
mod_update,
op_offset,
ops_anim,
ops_proxy,
ops_shapekey,
preferences,
ui,
)
from . import op_offset, ops_anim, ops_proxy, ops_shapekey, preferences, ui


classes = (
preferences.CommotionShapeKeyCollection,
preferences.CommotionPreferences,
preferences.SceneProperties,
preferences.WmProperties,
ui.VIEW3D_MT_commotion,
ui.VIEW3D_PT_commotion_update,
ui.VIEW3D_PT_commotion_animation_offset,
ui.VIEW3D_PT_commotion_animation_utils,
ui.VIEW3D_PT_commotion_shape_keys,
Expand All @@ -61,7 +37,6 @@
ops_anim.ANIM_OT_animation_convert,
ops_proxy.ANIM_OT_bake,
ops_proxy.ANIM_OT_bake_remove,
*mod_update.ops,
)


Expand All @@ -77,14 +52,6 @@ def register():

bpy.types.VIEW3D_MT_object.append(ui.draw_commotion_menu)

# mod_update
# ---------------------------

mod_update.init(
addon_version=bl_info["version"],
repo_url="mrachinskiy/commotion",
)


def unregister():
from . import proxy_effector
Expand Down
3 changes: 2 additions & 1 deletion _essential.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# SPDX-FileCopyrightText: 2021-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2021-2022 Mikhail Rachinskiy

# v1.1.1

from __future__ import annotations

from pathlib import Path
from typing import Any

Expand Down
12 changes: 12 additions & 0 deletions blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
schema_version = "1.0.0"
id = "commotion"
version = "2.4.0"
name = "Commotion"
tagline = "Animation offset tools for motion graphics"
maintainer = "Mikhail Rachinskiy"
type = "add-on"
tags = ["Animation"]
blender_version_min = "4.2.0"
website = "https://github.com/mrachinskiy/commotion"
license = ["SPDX:GPL-3.0-or-later"]
copyright = ["2014-2024 Mikhail Rachinskiy"]
2 changes: 1 addition & 1 deletion lib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

from bpy.types import AnimData, Object

Expand Down
9 changes: 2 additions & 7 deletions op_offset/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

from bpy.props import BoolProperty, EnumProperty, FloatProperty, IntProperty
from bpy.types import Operator
from bpy.props import (
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
)


class ANIM_OT_animation_offset(Operator):
Expand Down
2 changes: 1 addition & 1 deletion op_offset/offset_ad.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

from collections.abc import Iterable

Expand Down
4 changes: 2 additions & 2 deletions op_offset/offset_methods.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

import random
import operator
import random
from typing import Any, Iterator

import bpy
Expand Down
6 changes: 3 additions & 3 deletions ops_anim.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

from typing import Optional
from collections.abc import Sequence
from typing import Optional

from bpy.types import Operator, Object, Action, NlaTrack
from bpy.props import EnumProperty
from bpy.types import Action, NlaTrack, Object, Operator


NlaTracks = Sequence[NlaTrack]
Expand Down
2 changes: 1 addition & 1 deletion ops_proxy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

import bpy
from bpy.types import Operator
Expand Down
4 changes: 2 additions & 2 deletions ops_shapekey.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

from bpy.types import Operator
from bpy.props import EnumProperty
from bpy.types import Operator


class OBJECT_OT_sk_coll_refresh(Operator):
Expand Down
55 changes: 7 additions & 48 deletions preferences.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

from bpy.types import PropertyGroup, AddonPreferences, Collection
from bpy.props import (
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
FloatVectorProperty,
CollectionProperty,
PointerProperty,
)
from bpy.props import (BoolProperty, CollectionProperty, EnumProperty,
FloatProperty, FloatVectorProperty, IntProperty,
PointerProperty)
from bpy.types import Collection, PropertyGroup

from . import mod_update


# Proximity Effector utils
# Update callbacks
# -----------------------------------


Expand Down Expand Up @@ -67,31 +59,7 @@ class CommotionShapeKeyCollection(PropertyGroup):
selected: BoolProperty(description="Affect referenced shape key", default=True)


# Add-on preferences
# -----------------------------------


class CommotionPreferences(mod_update.Preferences, AddonPreferences):
bl_idname = __package__

def draw(self, context):
props_wm = context.window_manager.commotion

layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False

split = layout.split(factor=0.25)
col = split.column()
col.use_property_split = False
col.scale_y = 1.3
col.prop(props_wm, "prefs_active_tab", expand=True)

box = split.box()
mod_update.prefs_ui(self, box)


# Scene properties
# Scene/WM properties
# -----------------------------------


Expand Down Expand Up @@ -246,16 +214,7 @@ class SceneProperties(PropertyGroup):
)


# Window manager properties
# ------------------------------------------


class WmProperties(PropertyGroup):
prefs_active_tab: EnumProperty(
items=(
("UPDATES", "Updates", ""),
),
)
skcoll: CollectionProperty(type=CommotionShapeKeyCollection)
use_proxy: BoolProperty(
name="Proximity Effector",
Expand Down
2 changes: 1 addition & 1 deletion proxy_effector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

import bpy
from bpy.app.handlers import persistent
Expand Down
10 changes: 2 additions & 8 deletions ui.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# SPDX-FileCopyrightText: 2014-2024 Mikhail Rachinskiy
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2014-2022 Mikhail Rachinskiy

from bpy.types import Panel, Menu

from . import mod_update
from bpy.types import Menu, Panel


# Menus
Expand Down Expand Up @@ -44,10 +42,6 @@ class SidebarSetup:
bl_context = "objectmode"


class VIEW3D_PT_commotion_update(mod_update.Sidebar, SidebarSetup, Panel):
bl_label = "Update"


class VIEW3D_PT_commotion_shape_keys(SidebarSetup, Panel):
bl_label = "Shape Keys"
bl_options = {"DEFAULT_CLOSED"}
Expand Down
13 changes: 0 additions & 13 deletions var.py

This file was deleted.

0 comments on commit f0457ae

Please sign in to comment.