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

Update for Blender 2.90.1, Add Github Action #378

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/blender2-90-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Blender 2.90.1

on: [push, pull_request]

jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
# Name the Job
test:
name: All
# Set the type of machine to run on
runs-on: ubuntu-latest
strategy:
matrix:
blenderversion: [2.90.1]

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2

- run: sudo apt-get install --no-install-recommends -y libsdl1.2debian libglu1 python3-pip python3-setuptools
- run: pip3 install wheel
- run: sudo pip3 install -r requirements.txt
- run: ./tests/install_blender.sh ${{ matrix.blenderversion }}
- run: source .envs && make MAKE_OPTION=all BLENDER=$BLENDER_BIN PYLINT='python3 -m pylint'
2 changes: 1 addition & 1 deletion io_scene_godot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
bl_info = { # pylint: disable=invalid-name
"name": "Godot Engine Exporter",
"author": "Lu Jiacheng, Geoffrey Irons, Juan Linietsky",
"blender": (2, 80, 0),
"blender": (2, 90, 1),
"location": "File > Import-Export",
"description": ("Export Blender scenes to a format that can be "
"efficiently imported in Godot Engine."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,20 +414,21 @@ def __init__(self, code, input_sockets, output_properties):
"""),

ShaderFunction(code="""
void node_math_add_no_clamp(float value1, float value2, out float result) {
void node_math_add_no_clamp(float value1, float value2, float unused,
out float result) {
result = value1 + value2;
}
"""),

ShaderFunction(code="""
void node_math_subtract_no_clamp(float value1, float value2,
void node_math_subtract_no_clamp(float value1, float value2, float unused,
out float result) {
result = value1 - value2;
}
"""),

ShaderFunction(code="""
void node_math_multiply_no_clamp(float value1, float value2,
void node_math_multiply_no_clamp(float value1, float value2, float unused,
out float result) {
result = value1 * value2;
}
Expand All @@ -443,7 +444,8 @@ def __init__(self, code, input_sockets, output_properties):
"""),

ShaderFunction(code="""
void node_math_power_no_clamp(float val1, float val2, out float outval) {
void node_math_power_no_clamp(float val1, float val2, float unused,
out float outval) {
outval = pow(val1, val2);
}
"""),
Expand Down Expand Up @@ -492,7 +494,7 @@ def __init__(self, code, input_sockets, output_properties):

ShaderFunction(code="""
void node_math_greater_than_no_clamp(float value1, float value2,
out float result) {
float unused, out float result) {
result = float(value1 > value2);
}
"""), # nopep8
Expand Down Expand Up @@ -578,13 +580,15 @@ def __init__(self, code, input_sockets, output_properties):
"""),

ShaderFunction(code="""
void node_math_add_clamp(float value1, float value2, out float result) {
void node_math_add_clamp(float value1, float value2, float unused,
out float result) {
result = clamp(value1 + value2, 0.0, 1.0);
}
"""),

ShaderFunction(code="""
void node_math_subtract_clamp(float value1, float value2, out float result) {
void node_math_subtract_clamp(float value1, float value2, float unused,
out float result) {
result = clamp(value1 - value2, 0.0, 1.0);
}
"""),
Expand Down Expand Up @@ -735,8 +739,8 @@ def __init__(self, code, input_sockets, output_properties):
"""),

ShaderFunction(code="""
void node_vector_math_add(vec3 v1, vec3 v2, out vec3 outvec,
out float outval) {
void node_vector_math_add(vec3 v1, vec3 v2, vec3 unused, float unused2,
out vec3 outvec, out float outval) {
outvec = v1 + v2;
outval = (abs(outvec[0]) + abs(outvec[1]) + abs(outvec[2])) * 0.333333;
}
Expand Down
16 changes: 8 additions & 8 deletions tests/install_blender.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/sh
#!/bin/bash

set -e

BLENDER_VERSION=$1

BLENDER_LINUX_64_URL="https://mirror.clarkson.edu/blender/release/Blender${BLENDER_VERSION}/blender-${BLENDER_VERSION}-linux-glibc217-x86_64.tar.bz2"

BLENDER_DIRNAME_REGEX_PATTERN='/Blender2\.[0-9]+/(.+)\.tar\.bz2$'
# https://download.blender.org/source/blender-2.90.1.tar.xz
BLENDER_LINUX_64_URL="https://download.blender.org/release/Blender2.90/blender-2.90.1-linux64.tar.xz"
BLENDER_DIRNAME_REGEX_PATTERN='/blender-2\.[0-9]+(\.[0-9]+)?-(.+)\.tar\.xz$'
[[ ${BLENDER_LINUX_64_URL} =~ ${BLENDER_DIRNAME_REGEX_PATTERN} ]]
NAME=${BASH_REMATCH[1]}
echo $BLENDER_DIRNAME_REGEX_PATTERN
NAME=${BASH_REMATCH[0]%".tar.xz"}

CACHE="${HOME}/.blender-cache"
TAR="${CACHE}/${NAME}.tar.bz2"
TAR="${CACHE}/${NAME}.tar.xz"

echo "Installing Blender ${BLENDER_VERSION}"
mkdir -p $CACHE
if [ ! -f $TAR ]; then
wget -O $TAR $BLENDER_LINUX_64_URL
fi
tar -xjf $TAR -C $HOME
tar -xvf $TAR -C $HOME

echo "export BLENDER_BIN=\"${HOME}/${NAME}/blender\"" > .envs
21 changes: 15 additions & 6 deletions tests/reference_exports/material_cycle/material_cycle.escn
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ void node_combine_rgb(float r, float g, float b, out vec4 color) {
}


void node_math_multiply_no_clamp(float value1, float value2,
void node_math_multiply_no_clamp(float value1, float value2, float unused,
out float result) {
result = value1 * value2;
}
Expand Down Expand Up @@ -1059,32 +1059,38 @@ void fragment () {
// input sockets handling
float node2_in0_value = node1_out0_x;
float node2_in1_value = float(0.10000000149011612);
float node2_in2_value = float(0.0);
// output sockets definitions
float node2_out0_value;

node_math_multiply_no_clamp(node2_in0_value, node2_in1_value, node2_out0_value);
node_math_multiply_no_clamp(node2_in0_value, node2_in1_value, node2_in2_value,
node2_out0_value);


// node: 'Math.001'
// type: 'ShaderNodeMath'
// input sockets handling
float node3_in0_value = node1_out1_y;
float node3_in1_value = float(1.0);
float node3_in2_value = float(0.0);
// output sockets definitions
float node3_out0_value;

node_math_multiply_no_clamp(node3_in0_value, node3_in1_value, node3_out0_value);
node_math_multiply_no_clamp(node3_in0_value, node3_in1_value, node3_in2_value,
node3_out0_value);


// node: 'Math'
// type: 'ShaderNodeMath'
// input sockets handling
float node4_in0_value = node1_out2_z;
float node4_in1_value = float(0.10000000149011612);
float node4_in2_value = float(0.0);
// output sockets definitions
float node4_out0_value;

node_math_multiply_no_clamp(node4_in0_value, node4_in1_value, node4_out0_value);
node_math_multiply_no_clamp(node4_in0_value, node4_in1_value, node4_in2_value,
node4_out0_value);


// node: 'Combine RGB'
Expand Down Expand Up @@ -1437,7 +1443,8 @@ void node_bsdf_principled(vec4 color, float subsurface, vec4 subsurface_color,
}


void node_math_add_clamp(float value1, float value2, out float result) {
void node_math_add_clamp(float value1, float value2, float unused,
out float result) {
result = clamp(value1 + value2, 0.0, 1.0);
}

Expand Down Expand Up @@ -1484,10 +1491,12 @@ void fragment () {
// input sockets handling
float node2_in0_value = dot(node1_in0_input, vec3(0.333333, 0.333333, 0.333333));
float node2_in1_value = float(0.0);
float node2_in2_value = float(0.0);
// output sockets definitions
float node2_out0_value;

node_math_add_clamp(node2_in0_value, node2_in1_value, node2_out0_value);
node_math_add_clamp(node2_in0_value, node2_in1_value, node2_in2_value,
node2_out0_value);


// node: 'Principled BSDF'
Expand Down
5 changes: 3 additions & 2 deletions tests/reference_exports/material_cycle/material_geometry.escn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void node_combine_rgb(float r, float g, float b, out vec4 color) {


void node_math_greater_than_no_clamp(float value1, float value2,
out float result) {
float unused, out float result) {
result = float(value1 > value2);
}

Expand Down Expand Up @@ -108,11 +108,12 @@ void fragment () {
// input sockets handling
float node2_in0_value = node1_out0_x;
float node2_in1_value = float(0.0);
float node2_in2_value = float(0.0);
// output sockets definitions
float node2_out0_value;

node_math_greater_than_no_clamp(node2_in0_value, node2_in1_value,
node2_out0_value);
node2_in2_value, node2_out0_value);


// node: 'Combine RGB'
Expand Down

Large diffs are not rendered by default.