diff --git a/LICENSE b/LICENSE index e14364db..c7cd6c2d 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 1c1e2447..d03224f7 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,12 @@

-[![badge](https://img.shields.io/npm/v/sketchbook?style=flat-square)](https://www.npmjs.com/package/sketchbook) -[![badge](https://img.shields.io/travis/swift502/sketchbook?style=flat-square)](https://travis-ci.org/swift502/Sketchbook) -[![badge](https://img.shields.io/discord/730763393325334628?label=discord&style=flat-square)](https://discord.gg/fGuEqCe) +# Final update (20. Feb 2023) + +As I have no more interest in developing this project, it comes to a conclusion. In order to remain honest about the true state of the project, I am archiving this repository. + +- If you wish to modify Sketchbook feel free to fork it. +- To see if someone is currently maintaining a fork, check out the [Network Graph](https://github.com/swift502/Sketchbook/network). # 📒 Sketchbook @@ -39,7 +42,7 @@ All planned features can be found in the [GitHub Projects](https://github.com/sw You can define your own scenes in Blender, and then read them with Sketchbook. Sketchbook needs to run on a local server such as [http-server](https://www.npmjs.com/package/http-server) or [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to be able to load external assets. -#### Script tag + 1. Import: @@ -53,6 +56,8 @@ You can define your own scenes in Blender, and then read them with Sketchbook. S const world = new Sketchbook.World('scene.glb'); ``` + + ## Contributing -1. Get latest [Node.js](https://nodejs.org/en/) +1. Get the LTS version of [Node.js](https://nodejs.org/en/) 16 2. [Fork this repository](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) 3. Run `npm install` 4. Run `npm run dev` diff --git a/tools/PathGen.py b/tools/PathGen.py new file mode 100644 index 00000000..6e722a57 --- /dev/null +++ b/tools/PathGen.py @@ -0,0 +1,60 @@ +# Script aiding the creation of Sketchbook AI paths in Blender. +# Converts a vertex chain to a linked list of Sketchbook path nodes +# with the nodes' object data in the correct format. + +import bpy + +obj = bpy.context.selected_objects[0] +mesh = obj.data + +# Create node wrapper +parent = bpy.data.objects.new( obj.name + '_path', None ) +bpy.context.collection.objects.link(parent) +parent.empty_display_size = 1 +parent.empty_display_type = 'PLAIN_AXES' +parent.location = obj.location + +# Identify vertex neighbors +vertNeighbors = {} +for edge in mesh.edges: + v1 = edge.vertices[0] + v2 = edge.vertices[1] + + if str(v1) not in vertNeighbors: + vertNeighbors[str(v1)] = [] + vertNeighbors[str(v1)].append(v2) + + if str(v2) not in vertNeighbors: + vertNeighbors[str(v2)] = [] + vertNeighbors[str(v2)].append(v1) + +def getNodeName(index): + return obj.name + '_node' + str(index) + +# Generate path nodes +finished = [] +def generateNode(index, previousIndex): + + v = mesh.vertices[int(index)] + pos = v.co + + empty = bpy.data.objects.new( getNodeName(v.index), None ) + bpy.context.collection.objects.link(empty) + empty.empty_display_size = 1 + empty.empty_display_type = 'PLAIN_AXES' + empty.location = pos + empty.parent = parent + + nextIndex = vertNeighbors[str(index)][0] + if nextIndex == previousIndex: nextIndex = vertNeighbors[str(index)][1] + + empty['data'] = 'pathNode' + empty['path'] = obj.name + empty['nextNode'] = getNodeName(nextIndex) + empty['previousNode'] = getNodeName(previousIndex) + + finished.append(index) + if nextIndex not in finished: + generateNode(nextIndex, index) + +generateNode(0, vertNeighbors['0'][0])