Skip to content

Commit

Permalink
Merge pull request #5 from JacquesLucke/new-docs-for-refactor
Browse files Browse the repository at this point in the history
New docs for refactor
  • Loading branch information
JacquesLucke committed Oct 5, 2015
2 parents 063eff5 + e3630e8 commit 241e8d5
Show file tree
Hide file tree
Showing 86 changed files with 470 additions and 284 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Animation-Nodes-Documentation
=============================
Animation Nodes Manual
======================

http://animation-nodes-documentation.readthedocs.org/en/latest/
http://animation-nodes-manual.readthedocs.org/en/latest/

This is the Official **documentation** repository for the Animation Nodes Project.
This is the Official **Maunal** repository for the Animation Nodes Project.

If you want to contribute:

1. Fork https://github.com/JacquesLucke/Animation-Nodes-Documentation
1. Fork https://github.com/JacquesLucke/animation_nodes_manual
2. Add some useful description of nodes, images, examples, correct typos, ...
3. Create a pull request to integrate your modifications into the official repository
4. Wait for your modifications to be accepted
5. Congratulations, you have added some very useful information for future users!
5. Congratulations, you have added some very useful information for future users!


**You don't know what Animation-Nodes is?**
**You don't know what Animation Nodes is?**

Check it out! It's an awesome Blender add-on to easily animate about everything with a node based setup!

You can find the official **Animation-Nodes** repository at
https://github.com/JacquesLucke/animation-nodes
https://github.com/JacquesLucke/animation_nodes
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
master_doc = 'index'

project = u'Animation Nodes'
copyright = u'2014, Jacques Lucke'
copyright = u'2015, Jacques Lucke'

version = '0.0.1'
release = '0.0.1'
Expand Down Expand Up @@ -46,4 +46,4 @@
epub_author = u'Jacques Lucke'
epub_publisher = u'Jacques Lucke'
epub_copyright = u'2014, Jacques Lucke'
epub_exclude_files = ['search.html']
epub_exclude_files = ['search.html']
177 changes: 0 additions & 177 deletions docs/dev-guide/node_api.rst

This file was deleted.

52 changes: 0 additions & 52 deletions docs/dev-guide/socket_api.rst

This file was deleted.

87 changes: 87 additions & 0 deletions docs/dev_guide/getting_started/first_node.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
*******************
Creating a new Node
*******************

A node is a single python file. All registration is done automatically.

At first you have to decide in which category your node idea fits.

a) Choose one of the existing node categories (folders inside the ``nodes\\`` directory) or
b) Create a new category. To do that make a new folder and put an empty file called ``__init__.py`` inside.

Then create a new python file inside the category you choosed and copy the template in:

.. code-block:: python
:linenos:
import bpy
from ... base_types.node import AnimationNode
class TemplateNode(bpy.types.Node, AnimationNode):
bl_idname = "an_TemplateNode"
bl_label = "Template Node"
def create(self):
pass
def execute(self):
return
Replace *Template* with the name of your node.

.. code-block:: python
:linenos:
class RoundNumberNode(bpy.types.Node, AnimationNode):
bl_idname = "an_RoundNumberNode"
bl_label = "Round Number"
Create the input and output sockets in the ``create`` function:

.. code-block:: python
:linenos:
def create(self):
self.inputs.new("an_FloatSocket", "Number", "number")
self.inputs.new("an_IntegerSocket", "Decimals", "decimals")
self.outputs.new("an_FloatSocket", "Rounded Value", "value")
The parameters are:

1. ``bl_idname`` of the socket type. You find all existing types here: :ref:`socket-data-types`
2. Name of the socket that will be visible in the UI.
3. Variable name that will be used in the ``execute`` function

Fill in the execution code:

.. code-block:: python
:linenos:
def execute(self, number, decimals):
value = round(number, decimals)
return value
Save, start Blender test if your node works.
It isn't in the menu yet but you can find the node by searching for the ``bl_label`` property.


This is the final node file:

.. code-block:: python
:linenos:
import bpy
from ... base_types.node import AnimationNode
class RoundNumberNode(bpy.types.Node, AnimationNode):
bl_idname = "an_RoundNumberNode"
bl_label = "Round Number"
def create(self):
self.inputs.new("an_FloatSocket", "Number", "number")
self.inputs.new("an_IntegerSocket", "Decimals", "decimals")
self.outputs.new("an_FloatSocket", "Rounded Value", "value")
def execute(self, number, decimals):
value = round(number, decimals)
return value
8 changes: 8 additions & 0 deletions docs/dev_guide/getting_started/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Getting Started
===============

.. toctree::
:maxdepth: 2

setup_environment
first_node

0 comments on commit 241e8d5

Please sign in to comment.