Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Add Motor Operator #348

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AlpenAalAlex
Copy link
Collaborator

@AlpenAalAlex AlpenAalAlex commented Mar 11, 2024

Description

  • Enables the operator for batch editing
  • Disables it for fixed joints and links without joints
  • Correctly enables or disables the button, reducing confusion

Related Issue

Issue #212

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

Previously a link had to be the active object for the operator to be enabled. Now a link has to be in the selection and the operator will be applied to all links in the selection
@hwiedPro hwiedPro linked an issue Jun 13, 2024 that may be closed by this pull request
Copy link
Collaborator

@hwiedPro hwiedPro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except the indentation the rest looks fine to me.
How has this been tested?

@@ -1758,7 +1758,7 @@ def poll(cls, context):

class AddMotorOperator(Operator):
"""Add a motor to the selected joint.
It is possible to add motors to multiple joints at the same time"""
It is possible to add motors to multiple joints at the same time"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation change is faulty.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because the indentation is visible in the tooltip for the operator. With the indentation the tooltip looks like this:
grafik

After the change it looks like this:
grafik

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you add a line break before the closing """ with the correct level of indentation? Maybe this helps blender to find the correct line break. How is it done with the other operators?
Like this:

class AddMotorOperator(Operator):
    """Add a motor to the selected joint.
    It is possible to add motors to multiple joints at the same time
    """

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of them are all one liners except AddSensorOperator. How does the tooltip look there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Motor function
2 participants