Skip to content

Commit

Permalink
Revert "Merge pull request #4064 from Bforartists/issue#4063"
Browse files Browse the repository at this point in the history
This reverts commit f321673, reversing
changes made to ab65a7c.
  • Loading branch information
Draise14 committed Feb 5, 2024
1 parent f321673 commit fdc1b58
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 316 deletions.
1 change: 0 additions & 1 deletion scripts/startup/bl_ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"properties_world",
"properties_collection",
"generic_ui_list",
"generic_column_menu",

# Generic Space Modules
#
Expand Down
49 changes: 0 additions & 49 deletions scripts/startup/bl_ui/generic_column_menu.py

This file was deleted.

74 changes: 6 additions & 68 deletions scripts/startup/bl_ui/properties_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later

from bpy.types import Panel, Menu, Operator
from bpy.types import Panel
from bpy.app.translations import contexts as i18n_contexts
from bl_ui.generic_column_menu import GenericColumnMenu, fetch_op_data, InvokeMenuOperator


class ObjectConstraintPanel:
bl_context = "constraint"
Expand All @@ -30,39 +30,10 @@ class OBJECT_PT_constraints(ObjectConstraintPanel, Panel):

def draw(self, _context):
layout = self.layout
layout.operator("object.add_constraints_menu", icon='ADD')

layout.template_constraints(use_bone_constraints=False)

layout.operator_menu_enum("object.constraint_add", "type", text="Add Object Constraint")

class OBJECT_MT_constraint_add(GenericColumnMenu, Menu):
bl_description = "Add a constraint to the active object"

op_id = "object.constraint_add"
OPERATOR_DATA, TRANSLATION_CONTEXT = fetch_op_data(class_name="Constraint")
search_header = "Object Constraint"

def draw(self, _context):
layout = self.layout.row()

self.draw_operator_column(layout, header="Motion Tracking",
types=('CAMERA_SOLVER', 'FOLLOW_TRACK', 'OBJECT_SOLVER'))
self.draw_operator_column(layout, header="Transform",
types=('COPY_LOCATION', 'COPY_ROTATION', 'COPY_SCALE', 'COPY_TRANSFORMS', 'LIMIT_DISTANCE', 'LIMIT_LOCATION', 'LIMIT_ROTATION', 'LIMIT_SCALE', 'MAINTAIN_VOLUME', 'TRANSFORM', 'TRANSFORM_CACHE'))
self.draw_operator_column(layout, header="Tracking",
types=('CLAMP_TO', 'DAMPED_TRACK', 'LOCKED_TRACK', 'STRETCH_TO', 'TRACK_TO'))
self.draw_operator_column(layout, header="Relationship",
types=('ACTION', 'ARMATURE', 'CHILD_OF', 'FLOOR', 'FOLLOW_PATH', 'PIVOT', 'SHRINKWRAP'))


class OBJECT_OT_add_constraints_menu(InvokeMenuOperator, Operator):
bl_idname = "object.add_constraints_menu"
bl_label = "Add Object Constraint"
bl_description = "Add a constraint to the active object"

menu_id = "OBJECT_MT_constraint_add"
space_type = 'PROPERTIES'
space_context = 'CONSTRAINT'
layout.template_constraints(use_bone_constraints=False)


class BONE_PT_constraints(BoneConstraintPanel, Panel):
Expand All @@ -73,39 +44,10 @@ class BONE_PT_constraints(BoneConstraintPanel, Panel):

def draw(self, _context):
layout = self.layout
layout.operator("bone.add_constraints_menu", icon='ADD')

layout.template_constraints(use_bone_constraints=True)


class BONE_MT_constraint_add(GenericColumnMenu, Menu):
bl_description = "Add a constraint to the active bone"

op_id = "pose.constraint_add"
OPERATOR_DATA, TRANSLATION_CONTEXT = fetch_op_data(class_name="Constraint")
search_header = "Bone Constraint"

def draw(self, _context):
layout = self.layout.row()

self.draw_operator_column(layout, header="Motion Tracking",
types=('CAMERA_SOLVER', 'FOLLOW_TRACK', 'OBJECT_SOLVER'))
self.draw_operator_column(layout, header="Transform",
types=('COPY_LOCATION', 'COPY_ROTATION', 'COPY_SCALE', 'COPY_TRANSFORMS', 'LIMIT_DISTANCE', 'LIMIT_LOCATION', 'LIMIT_ROTATION', 'LIMIT_SCALE', 'MAINTAIN_VOLUME', 'TRANSFORM', 'TRANSFORM_CACHE'))
self.draw_operator_column(layout, header="Tracking",
types=('CLAMP_TO', 'DAMPED_TRACK', 'IK', 'LOCKED_TRACK', 'SPLINE_IK', 'STRETCH_TO', 'TRACK_TO'))
self.draw_operator_column(layout, header="Relationship",
types=('ACTION', 'ARMATURE', 'CHILD_OF', 'FLOOR', 'FOLLOW_PATH', 'PIVOT', 'SHRINKWRAP'))

layout.operator_menu_enum("pose.constraint_add", "type", text="Add Bone Constraint")

class BONE_OT_add_constraints_menu(InvokeMenuOperator, Operator):
bl_idname = "bone.add_constraints_menu"
bl_label = "Add Bone Constraint"
bl_description = "Add a constraint to the active bone"

menu_id = "BONE_MT_constraint_add"
space_type = 'PROPERTIES'
space_context = 'BONE_CONSTRAINT'
layout.template_constraints(use_bone_constraints=True)


# Parent class for constraint panels, with templates and drawing methods
Expand Down Expand Up @@ -1926,11 +1868,7 @@ def draw(self, context):
classes = (
# Object Panels
OBJECT_PT_constraints,
OBJECT_MT_constraint_add,
OBJECT_OT_add_constraints_menu,
BONE_PT_constraints,
BONE_MT_constraint_add,
BONE_OT_add_constraints_menu,
OBJECT_PT_bChildOfConstraint,
OBJECT_PT_bTrackToConstraint,
OBJECT_PT_bKinematicConstraint,
Expand Down

0 comments on commit fdc1b58

Please sign in to comment.