-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
956 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# release title (appears, for example, in repo's sidebar) | ||
# NOTE: $RESOLVED_VERSION == $MAJOR.$MINOR.$PATCH | ||
name-template: "v$RESOLVED_VERSION" | ||
|
||
# git tag to be used for the release | ||
tag-template: "v$RESOLVED_VERSION" | ||
|
||
# Release Notes template (keep it as is) | ||
template: | | ||
## What’s Changed | ||
$CHANGES | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
|
||
# Define which PR label will cause which kind of | ||
# version bump (following semantic versioning). | ||
# If no labels match, the default "patch". | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
|
||
# Define which PR label will be listed in which | ||
# category of changes in the Release Notes. | ||
# If no labels match, the default is to be | ||
# listed on the top, before the sections. | ||
categories: | ||
- title: "🚨 BREAKING CHANGES 🚨" | ||
labels: | ||
- "BREAKING CHANGE" | ||
- title: "🚀 New Features" | ||
labels: | ||
- "feature" | ||
- "enhancement" | ||
- title: "🐛 Bug Fixes" | ||
labels: | ||
- "fix" | ||
- "bug" | ||
- title: "🛠️ Other Changes" | ||
labels: | ||
- "chore" | ||
- "refactor" | ||
- "documentation" | ||
- "style" | ||
- "test" | ||
- "revert" | ||
- "dependencies" | ||
- "ci" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, reopened, synchronize, labeled, unlabeled] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release_draft: | ||
permissions: | ||
# write permission required to create a github release | ||
contents: write | ||
# write permission required for autolabeler | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Upload Assets to Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "release/*" | ||
|
||
jobs: | ||
# draft_release: | ||
# name: Draft Release | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# upload_url: ${{ steps.draft_release.outputs.upload_url }} | ||
# version: ${{ steps.set_env.outputs.version }} | ||
# steps: | ||
# - name: Set Version Env | ||
# id: set_env | ||
# run: | | ||
# ref_name=${{ github.ref_name }} | ||
# echo "version=${ref_name#release/}" >> "$GITHUB_OUTPUT" | ||
# - name: Get release | ||
# id: draft_release | ||
# uses: cardinalby/[email protected] | ||
# with: | ||
# releaseName: Draft | ||
# env: | ||
# GITHUB_TOKEN: ${{ github.token }} | ||
|
||
draft_release: | ||
name: Draft Release | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.draft_release.outputs.upload_url }} | ||
version: ${{ steps.set_env.outputs.version }} | ||
steps: | ||
- name: Set Version Env | ||
id: set_env | ||
run: | | ||
ref_name=${{ github.ref_name }} | ||
echo "version=${ref_name#release/}" >> "$GITHUB_OUTPUT" | ||
- name: Draft Release ${{ steps.set_env.outputs.version }} | ||
uses: release-drafter/release-drafter@v5 | ||
id: draft_release | ||
with: | ||
name: ${{ steps.set_env.outputs.version }} | ||
tag: ${{ steps.set_env.outputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
upload_blender_addon: | ||
name: Upload Blender Add-on | ||
needs: draft_release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Zip Add-on | ||
run: | | ||
zip -r package.zip bioxelnodes | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.draft_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./package.zip | ||
asset_name: BioxelNodes_${{ needs.draft_release.outputs.version }}.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# BioxelNodes | ||
BioxelNodes is a blender add-on for better volume data visualization with cycles. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import bpy | ||
from .utils import get_bioxels_obj | ||
|
||
|
||
class ConvertToMesh(bpy.types.Operator): | ||
bl_idname = "bioxelnodes.convert_to_mesh" | ||
bl_label = "Bioxels To Mesh" | ||
bl_description = "Convert Bioxels To Mesh." | ||
bl_options = {'UNDO'} | ||
|
||
def execute(self, context): | ||
bioxels_objs = [] | ||
for obj in bpy.context.selected_objects: | ||
bioxels_obj = get_bioxels_obj(obj) | ||
if bioxels_obj: | ||
bioxels_objs.append(bioxels_obj) | ||
|
||
if len(bioxels_objs)==0: | ||
self.report({"WARNING"}, "Cannot find any bioxels.") | ||
return {'FINISHED'} | ||
|
||
for bioxels_obj in bioxels_objs: | ||
bpy.ops.mesh.primitive_cube_add( | ||
size=2, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1)) | ||
mesh_obj = bpy.context.active_object | ||
|
||
mesh_obj.name = f"{bioxels_obj.parent.name}_Mesh" | ||
bpy.ops.node.new_geometry_nodes_modifier() | ||
modifier = mesh_obj.modifiers[0] | ||
nodes = modifier.node_group.nodes | ||
links = modifier.node_group.links | ||
|
||
output_node = nodes.get("Group Output") | ||
object_node = nodes.new("GeometryNodeObjectInfo") | ||
realize_nodes = nodes.new("GeometryNodeRealizeInstances") | ||
object_node.inputs[0].default_value = bioxels_obj | ||
object_node.transform_space = 'RELATIVE' | ||
|
||
links.new(object_node.outputs['Geometry'], realize_nodes.inputs[0]) | ||
links.new(realize_nodes.outputs[0], output_node.inputs[0]) | ||
bpy.ops.object.convert(target='MESH') | ||
bpy.context.object.active_material_index = 1 | ||
bpy.ops.object.material_slot_remove() | ||
|
||
return {'FINISHED'} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.