blender-iks-to-fks
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -0,1 +1,5 @@ | ||
## 1.4.2 | ||
- Fix issue where we weren't deleting all of the old keyframes | ||
## 1.3.4 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "blender-iks-to-fks", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "A Blender script that takes a mesh and armature that use IKs and other non-deformation bones and creates a new mesh and armature that uses only FK bones", | ||
@@ -5,0 +5,0 @@ "main": "bin/ik2fk.js", |
@@ -53,2 +53,6 @@ blender-iks-to-fks [![npm version](https://badge.fury.io/js/blender-iks-to-fks.svg)](http://badge.fury.io/js/blender-iks-to-fks) [![Build Status](https://travis-ci.org/chinedufn/blender-iks-to-fks.svg?branch=master)](https://travis-ci.org/chinedufn/blender-iks-to-fks) | ||
`blender-iks-to-fks` will delete all non-deformation bones when creating your rig, so be sure to uncheck `use deform` for your IK and control bones. | ||
You can do this in the `Bone` panel while in `Edit Mode`. | ||
### In Blender Window: | ||
@@ -55,0 +59,0 @@ |
@@ -41,30 +41,43 @@ var test = require('tape') | ||
test('Old and new armature have same animations', function (t) { | ||
t.plan(1) | ||
// TODO: Combine these two arrays into an object {legBlendFile: 10} | ||
var filesToTest = [ | ||
legBlendFile | ||
] | ||
var framesToRender = [ | ||
10 | ||
] | ||
var bothImagesRendered | ||
var beforeFile = path.resolve(__dirname, './before') | ||
var afterFile = path.resolve(__dirname, './after') | ||
t.plan(filesToTest.length) | ||
// Render our model without converting it into FK | ||
cp.exec( | ||
`blender -b ${legBlendFile} --render-output ${beforeFile} --render-frame 10 --render-format PNG -noaudio`, | ||
function (err, stdout, stderr) { | ||
if (err) { throw err } | ||
// An index for each of our test files on whether or not the before and after have been rendered | ||
// i.e. bothImagesRendered[2] = true means the third test file has had its before and after rendered | ||
var bothImagesRendered = {} | ||
compareBeforeAndAfter() | ||
bothImagesRendered = true | ||
} | ||
) | ||
filesToTest.forEach(function (testFile, testFileNum) { | ||
var beforeFile = path.resolve(__dirname, `./before_${testFileNum}_`) | ||
var afterFile = path.resolve(__dirname, `./after_${testFileNum}_`) | ||
// Render our model after converting it into FK | ||
cp.exec( | ||
`blender -b ${legBlendFile} --python ${runAddon} --render-output ${afterFile} --render-frame 10 --render-format PNG -noaudio`, | ||
function (err, stdout, stderr) { | ||
if (err) { throw err } | ||
// Render our model without converting it into FK | ||
cp.exec( | ||
`blender -b ${testFile} --render-output ${beforeFile} --render-frame ${framesToRender[testFileNum]} --render-format PNG -noaudio`, | ||
function (err, stdout, stderr) { | ||
if (err) { throw err } | ||
compareBeforeAndAfter() | ||
bothImagesRendered = true | ||
} | ||
) | ||
compareBeforeAndAfter(testFileNum) | ||
bothImagesRendered[testFileNum] = true | ||
} | ||
) | ||
// Render our model after converting it into FK | ||
cp.exec( | ||
`blender -b ${testFile} --python ${runAddon} --render-output ${afterFile} --render-frame ${framesToRender[testFileNum]} --render-format PNG -noaudio`, | ||
function (err, stdout, stderr) { | ||
if (err) { throw err } | ||
compareBeforeAndAfter(testFileNum) | ||
bothImagesRendered[testFileNum] = true | ||
} | ||
) | ||
}) | ||
/** | ||
@@ -76,7 +89,8 @@ * Compare the rendering with and without our converted FK armature and make sure that they are exactly the same. | ||
*/ | ||
function compareBeforeAndAfter () { | ||
t.plan(1) | ||
function compareBeforeAndAfter (testFileNum) { | ||
var beforeFile = path.resolve(__dirname, `./before_${testFileNum}_`) | ||
var afterFile = path.resolve(__dirname, `./after_${testFileNum}_`) | ||
if (bothImagesRendered) { | ||
cp.exec(`compare -metric RMSE ${beforeFile}0010.png ${afterFile}0010.png /dev/null`, function (_, stdout, stderr) { | ||
if (bothImagesRendered[testFileNum]) { | ||
cp.exec(`compare -metric RMSE ${beforeFile}00${framesToRender[testFileNum]}.png ${afterFile}00${framesToRender[testFileNum]}.png /dev/null`, function (_, stdout, stderr) { | ||
// Compare will write the comparison to stderr. We parse their | ||
@@ -90,7 +104,6 @@ // It looks like this: | ||
// Delete our test renderings | ||
fs.unlinkSync(`${beforeFile}0010.png`) | ||
fs.unlinkSync(`${afterFile}0010.png`) | ||
fs.unlinkSync(`${beforeFile}00${framesToRender[testFileNum]}.png`) | ||
fs.unlinkSync(`${afterFile}00${framesToRender[testFileNum]}.png`) | ||
t.ok(rootSquareMeanError < 0.0002, 'New mesh and armature have the same animations as the old mesh and armature') | ||
t.end() | ||
}) | ||
@@ -97,0 +110,0 @@ } |
Sorry, the diff of this file is not supported yet
2563629
357
111