-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
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
There was a problem hiding this 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.
|
||
|
||
# create a JSON camera path from the Blender camera animation | ||
class CreateJSONCameraPath(bpy.types.Operator): |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.""" |
There was a problem hiding this comment.
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)
Updated pylint formatting and comments
* 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
* 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
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.