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

Blender addon script and documentation #1218

Merged
merged 9 commits into from
Jan 20, 2023
Merged

Blender addon script and documentation #1218

merged 9 commits into from
Jan 20, 2023

Conversation

cvachha
Copy link
Contributor

@cvachha cvachha commented Jan 10, 2023

First version of blender addon python script located in scripts/blender and new documentation for the addon. The Blender addon is for importing or exporting a camera path for visual effects and compositing.

First version of blender addon python script located in scripts/blender and new documentation for the addon. The Blender addon is for importing or exporting a camera path for visual effects and compositing.
Updated the formatting based on the script tests for the blender addon script.
Updated how FOV is calculated for both blender cam to json and json to blender cam. The FOV is calculated based on the aspect ratio, angle of view, and sensor fit and size.
Updated the Blender add-on documentation with a few example gif composite animations
Copy link
Contributor

@tancik tancik left a comment

Choose a reason for hiding this comment

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

Higher level comments on code style. I realize this can be a bit annoying to fix, but happy to work through it with you. Looking great otherwise.

scripts/blender/nerfstudio_addon_1_0.py Outdated Show resolved Hide resolved


# create a JSON camera path from the Blender camera animation
class CreateJSONCameraPath(bpy.types.Operator):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add docstrings to this file in the same way that the rest of the repo does. In addition to types. I'm happy to walk through some of the typing if you have questions.

@@ -0,0 +1,404 @@
bl_info = {
"name": "Nerfstudio Add-On",
Copy link
Contributor

Choose a reason for hiding this comment

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

Add an empty file scripts/blender/__init__.py
This will cause the linter to parse it. Then run ns-dev-test, you will likely see many lint issues. These should be resolved, sometime they can be a bit tricky, feel free to let me know if you have questions.

@tancik tancik linked an issue Jan 17, 2023 that may be closed by this pull request
Updated the Blender add-on script and docs to match the Blender frame rate. Also the formatting should be fixed. There are also now error message popups instead of console prints for invalid input in the add-on.
Copy link
Contributor

@tancik tancik left a comment

Choose a reason for hiding this comment

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

A couple minor comments.

"category": "Nerfstudio",
}

import json
from math import atan, degrees, radians, tan
import json # pylint: disable=wrong-import-position
Copy link
Contributor

Choose a reason for hiding this comment

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

I think # pylint: disable=wrong-import-position can be added once at the top of the file


return {"FINISHED"}


# --- Blender UI Panel --- #


class NerfstudioMainPanel(bpy.types.Panel):
class NerfstudioMainPanel(bpy.types.Panel): # pylint: disable=too-few-public-methods
"""Blener UI main panel for the add-on."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Blener -> Blender
(Also in following functions)

@tancik tancik merged commit 9eb880a into main Jan 20, 2023
@tancik tancik deleted the cyrus/blender_addon branch January 20, 2023 06:31
lucasthahn pushed a commit to tne-ai/nerfstudio that referenced this pull request Jan 26, 2023
* Blender addon script and documentation

First version of blender addon python script located in scripts/blender and new documentation for the addon. The Blender addon is for importing or exporting a camera path for visual effects and compositing.

* Updated formatting of Blender script

Updated the formatting based on the script tests for the blender addon script.

* Updated Blender addon to fix FOV and alignment

Updated how FOV is calculated for both blender cam to json and json to blender cam. The FOV is calculated based on the aspect ratio, angle of view, and sensor fit and size.

* Updated Blender addon documentation with examples

Updated the Blender add-on documentation with a few example gif composite animations

* Updated Blender addon to match frame rate and fixed formatting

Updated the Blender add-on script and docs to match the Blender frame rate. Also the formatting should be fixed. There are also now error message popups instead of console prints for invalid input in the add-on.

* Updated the blender addon for formatting

Updated pylint formatting and comments
chris838 pushed a commit to chris838/nerfstudio that referenced this pull request Apr 22, 2023
* Blender addon script and documentation

First version of blender addon python script located in scripts/blender and new documentation for the addon. The Blender addon is for importing or exporting a camera path for visual effects and compositing.

* Updated formatting of Blender script

Updated the formatting based on the script tests for the blender addon script.

* Updated Blender addon to fix FOV and alignment

Updated how FOV is calculated for both blender cam to json and json to blender cam. The FOV is calculated based on the aspect ratio, angle of view, and sensor fit and size.

* Updated Blender addon documentation with examples

Updated the Blender add-on documentation with a few example gif composite animations

* Updated Blender addon to match frame rate and fixed formatting

Updated the Blender add-on script and docs to match the Blender frame rate. Also the formatting should be fixed. There are also now error message popups instead of console prints for invalid input in the add-on.

* Updated the blender addon for formatting

Updated pylint formatting and comments
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.

Fbx Import for Camera Tracking
2 participants