Coder Social home page Coder Social logo

aachman98 / sorcar Goto Github PK

View Code? Open in Web Editor NEW
1.2K 70.0 110.0 12.11 MB

Procedural modeling in Blender using Node Editor

Home Page: https://aachman98.itch.io/sorcar

License: GNU General Public License v3.0

Python 100.00%
procedural-generation blender-addon blender3d blender-python procedural

sorcar's Introduction

Sorcar

Procedural modeling in Blender using Node Editor

sc_cover


BlenderArtist Thread: https://blenderartists.org/t/sorcar-procedural-modeling-in-blender-using-node-editor/1156769
Intro & Tutorials: https://www.youtube.com/playlist?list=PLZiIC3gdS_O7nCm1-xpWbZmTQWeL5c6KV
Trello (Project Tracker): https://trello.com/b/aKIFRoTh/sorcar
Documentation: https://github.com/aachman98/Sorcar/wiki

About

Sorcar is a procedural modeling node-based system which utilises Blender and its Python API to create a visual programming environment for artists and developers. Heavily inspired by Side-FX Houdini, it presents a node editor with a variety of modular nodes to make the modelling workflow easier and fast. Most of the nodes are blender internal operations (bpy.ops.mesh/object) which also makes it easier for frequent blender users to manipulate geometry. It helps the users to quickly create 3D models and control node parameters to generate limitless variations in a non-destructive manner. It also provides the users to view and edit mesh on any stage of the node network independently, with realtime updates.

Release & Instructions

Latest Release (v3.2.1)
Requirement: Blender 2.81 or later

  1. Download the zip file and install it as a Blender addon (Edit -> Preferences... -> Add-ons -> Install...)
  2. Open Sorcar Node Editor (Do not remove the 3D viewport as it is required by some operations like extrude, transform, ...)
  3. Click on the + button to create a new tree
  4. Press Shift+A to open the nodes menu. Alternatively, navigate through tabs on the Right panel in the node editor
  5. Select the desired node and press "Set Preview"

Open blender using a command prompt to view logs and errors, if encountered.

Features

sc_visual_programming

VISUAL PROGRAMMING
Don't like programming?


Construct geometries using custom algorithms, maths or generate patterns without writing a single line of code!

NON-DESTRUCTIVE WORKFLOW
Want to change cylinder vertices after bevel?


Edit node parameters at any point without the fear of losing mesh data. Also apply same procedural operations to different objects easily.

sc_non_destructive
sc_realtime_updates

REAL-TIME UPDATES
Quick as the wind...


Drive a parameter using current frame value (or manually change it) and see the mesh update in viewport.

ITERATE & RANDOMIZE
Need multiple extrusions of random amount?


Generate variations in mesh by using seed-controlled pseudorandom numbers. Use loops to handle repeatitive operations with same level of randomness.

sc_iterate_randomize
sc_automation

AUTOMATION
Modify, Save, Repeat...


Use frame number to drive seed value and batch export the meshes in different files.

250+ NODES
At your service!


A growing list of functions available as nodes (operators & scene settings) including custom inputs, curve/mesh conversion, selection & transform tools, modifiers and component level operators.

sc_nodes
  • Node-Groups to collapse big node networks into a single node with custom inputs & outputs
  • Simplified node sockets with internal data conversion for the convenience of users.
  • Colour-coded nodes (preview, error, invalid inputs etc.) for easier debugging.
  • Multi-level heirarchy & auto-registration of classes for easy development of custom nodes in any category (existing or new).

and more...!

Nodes

sc_inputs Inputs
Primitive Meshes (Cube, Cylinder, Sphere, ...), Empty Object, Import FBX, Custom Object from the scene, Create Object using arrays of Vertices, Edges & Faces
sc_curves Curves
Custom Curve from the scene, Text, Import SVG, Geometry/Shape/Spline Properties, Mesh-Curve or Curve-Mesh Conversion
sc_transform Transform
Set/Add/Randomize transform (Edit/Object mode), Apply/Copy transform in world/local axes, Create custom orientation
sc_selection Selection
Manual, invert/toggle, loops, random, similar components or by their property (location, index, normal, material, ...)
sc_deletion Deletion
Delete/Dissolve selected components (or loops)
sc_component_operators Component Operators
Bevel, Decimate, Extrude, Fill, Inset, Loop Cut, Merge, Offset Loop, Poke, Screw, Spin, Subdivide, UV Map, Assign material or vertex groups
sc_object_operators Object Operators
Duplicate, Raycast/Overlap, Merge, Scatter, Set/Clear Parent, Voxel/QuadriFlow Remesh, Shading, Viewport Draw Mode
sc_modifiers Modifiers
Array, Bevel, Boolean, Build, Cast, Curve, Decimate, Remesh, Shrinkwrap, Skin, Solidify, Subsurf, Wave, Weighted Normal, Wireframe
sc_constants Constants
Number (Float/Int/Angle/Random), Bool, Vector, String, Selection Type (Face/Vert/Edge)
sc_arrays Arrays
Create/Append Arrays, Add/Remove elements, Reverse, Search, Clear, Count, Get
sc_noise Noise
Cell (Vector/Float), Fractal, Multi-Fractal, Hetero-Terrain, Ridged, Turbulence (Vector/Float), Variable Lacunarity, Voronoi
sc_utilities Utilities
String/Bool/Vector ops, Maths, Clamp, Map, Trigonometry, Get/Set Variables, Node-Groups, Scene/Component/Object Info, Custom Python Script
sc_flow_control Flow Control
For loop, For-Each loop (Array/Components), If-Else Branch
sc_settings Settings
Cursor Transform, Edit Mode, Pivot Point, Snapping, Proportional Editing, Transform Orientation

Upcoming Feature

  1. Export nodes as python code
  2. Send to UE4/Unity (live-link)
  3. Point scatter & voronoi fracture nodes
  4. Debugging tools: Watch/track values of node parameters

Future

  1. Complete integration with Blender's internal dependency graph
  2. Node-Viewport link: Create nodes automatically in editor based on actions in 3D viewport
  3. Landscape (noise/masking/erosion) and Foliage (grass/bush/trees) nodes

Showcase

sc_logo sc_showcase

Changelog

v3.2.1

  • Added support for object registration & unregistration on each evaluation (handled by nodetree instead of individual nodes)
  • Added custom variables in "Custom Python Script" node: _C (bpy context), _D (bpy data), _O (bpy ops), _S (context scene), _N (self node), _NT (self nodetree), _VAR (nodetree variables), _IN (input socket data)
  • Added "Select by Index Array" selection node
  • Added "Default" input socket in "Get Variable" node to set value if variable not initialised
  • Added "Hide Original" bool input prop in "Scatter" node
  • Added "Clear Variables" nodetree property in "Properties" UI panel to clear data on re-evaluation
  • Added "Clear Preview" operator (shortcut: Alt+E) to clear current preview node
  • Added "Execute Node" & "Clear Preview" ops to "Utilities" UI panel
  • Improved "Send to Sverchok" node to include selection mask with mesh data sent
  • Improved "Receive from Sverchok" node to set selection mask to mesh data received
  • Improved "Get/Set Variable" nodes to initialise empty variable in nodetree before accessing property
  • Improved "Execute Node" operator: removed redundant tree type check
  • Improved "apply_all_modifiers" & "remove_object" helper methods
  • Fixed "Separate" node: object array output instead of single object
  • Fixed socket interface classes for node-groups
  • Fixed "Select Vertices by Connection": switch to vertex mode before selection
  • Renamed "Merge" & "Delete" nodes: added "Component" suffix
  • Renamed "Cursor" node to "Cursor Transform"
  • Renamed "File" input socket to "Directory" in "Export FBX" node

v3.2.0

  • Added "Node Group" utility node
  • Added "Group Nodes" and "Edit Group" operators to create/modify node groups
  • Added new keymaps for creating and editing node groups (Ctrl+G, Tab)
  • Added UI panel base class and 3 new panels: "Properties", "Utilities" and "Node Groups"
  • Added "Send to Sverchok" utility node to pass mesh data (verts/edges/faces) to Sverchok node (Requires "Receive From Sorcar" node in Sverchok nodetree; awaiting PR #3281)
  • Added "Receive from Sverchok" input node to fetch mesh data (verts/edges/faces) from Sverchok node (Requires "Send To Sorcar" node in Sverchok nodetree; W.I.P.)
  • Added "Text Block" constant node to output multi-line string from Text Editor
  • Added node interface base class and sub-classes for all sockets to support node-groups (with custom properties)
  • Added Wiki and Bug Reporter links in add-ons manager (#127)
  • Improved object input nodes to clean up geometry when removed
  • Improved socket base class to show error icon when execution fails
  • Improved "Custom Object" input node: inherit from input base class, apply all modifiers before execution
  • Improved Import/Export nodes to select directory path using file picker UI
  • Improved "Material Parameter" node to show all available nodes & sockets as a drop-down (search)
  • Improved "Scene Info" node: added new outputs for world unit scale length, active/selected/all objects from the scene; removed "Realtime" tree property
  • Improved "Duplicate Object" node: added "Linked" input socket
  • Improved "get_override" and "sc_poll_op" helper methods
  • Improved all operators: show tooltips, new category (prefix)
  • Improved all socket base classes to support node-groups
  • Fixed socket base class to avoid executing node-group input nodes
  • Fixed "Dissolve" node
  • Fixed nodetree execution
  • Fixed "Array" socket label (length of the evaluated array)
  • Fixed "Instancing" node

v3.1.6

  • Added "Set Dimensions" & "Set Object Name" object operator nodes
  • Added "Add ..." input nodes to append primitive object geometry to current object
  • Added "set_preview" method in nodetree class
  • Added curve ops base class & "Curve Shape/Geometry/Spline Properties" nodes
  • Improved "Object Info" node to output object's name, dimensions and bounding box vertices
  • Improved "Component Info" node to output face area
  • Renamed input nodes to "Create ..." (added prefix)
  • Renamed "update_ext" nodetree method to "set_value"
  • Fixed "remove_object" helper function
  • Fixed vertex group selection & component operator nodes
  • Fixed "get_override" helper method to search for correct window/area/region

v3.1.5

  • Added keymap support to quickly execute selected node (Key: 'E')
  • Added new "Curve" category & socket to handle objects with curve data
  • Added method for modifying node parameter externally (automatically re-evaluates nodetree)
  • Added "Import SVG" & "Text" curve input nodes
  • Added "Convert to Mesh" & "Convert to Curve" nodes
  • Added "Create Object" input node
  • Added "QuadriFlow Remesh" object operator node
  • Added "Warp" & "Randomize Vertices" transform nodes
  • Added Weld, Lattice, Shrinkwrap & Weighted Normal modifier nodes
  • Added "Proportional Editing" & "Snap" settings node
  • Added "Clear Parent", "Get Parent", & "Get Children" object operator nodes
  • Improved "Scatter" node to support instanced scattering
  • Improved "Maths Operation" node to include more operations & better menu layout
  • Improved "Parent" node to include option to set the inverse parent correction
  • Improved "Skin Modifier" node to allow skin resize for selected vertices
  • Renamed transform nodes to "World/Local Transform"
  • Fixed issue with Crease, Edge-Slide, Skin-Resize local transform
  • Fixed custom object/curve nodes to hide original object
  • Fixed issue with rerouting socket connections
  • Fixed transform nodes to use snapping & proportional editing settings
  • Fixed object deletion helper method to remove orphaned data
  • Fixed "Select Nth" node parameter minimum value

v3.1.4

  • Added "Voxel Remesh" object operator node
  • Added "Raycast (Scene)" utility node (renamed "Raycast" to "Raycast (Object)")
  • Added "Instancing" & "Parent" object operator nodes
  • Added "Empty" and "Single Vertex" input nodes
  • Added "Hide/Unhide Component" and "Mark Component" nodes
  • Fixed "Element" output pin type of "Begin For-Each Loop" node
  • Fixed issue with addon activation
  • Fixed int conversion in "Shortest Path" selection nodes

v3.1.3

  • Added "For-Each Component Loop" nodes
  • Added "Get/Set Variable" nodes
  • Added "To Sphere" transform node
  • Added "Select Vertices by Connections" selection node
  • Fixed issue with reset() attribute
  • Improved "For" & "For-Each" loop nodes
  • Improved "Select Manually" node

v3.1.2

  • Added noise nodes (cell, fractal, voronoi, ...) in a new category "Noise"
  • Added array operation nodes (add, remove, search, ...) in a new category "Arrays"
  • Added "Material Parameter" node
  • Renamed "Edit Mode" node to "Set Selection Mode"
  • Moved "Get Element" & "Make Array" node to "Arrays" category
  • Added selection type input socket in "Set Selection Mode" node
  • Added custom overridable method for socket layout drawing
  • Removed redundant sorcar_updater folder (also added in gitignore)

v3.1.1

  • Added addon updator by CGCookie
  • Fixed issue with realtime update checkbox in "Scene Info" node
  • New socket type: Selection Type
  • Ability to change selection type directly though selection nodes
  • Added issue templates for bug report & feature request

v3.1.0

  • Support for Blender 2.8
  • New architecture for data flow node executions
  • Improved socket types and node hierarchy
  • Internal data conversions

Contributors

And the amazing BlenderArtists community!

sorcar's People

Contributors

aachman98 avatar brentaritchie avatar corpse-sys avatar devilvalley avatar sevenneumann avatar tm9k1 avatar zebus3d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sorcar's Issues

Shading smooth for hardsurface

Can you maybe add a extra option for the node set shading smooth for hardsurface ( auto smooth for example 30 or lower or higher etc...

image

Set location /Rotation /Scale

Set location /Rotation /Scale is this the same like Apply Location / Rotation/Scale in object mode ?

I think this works not the correct or do you use these node for other things

image

image

Resize uniform or Random

Random resize works fine , but is there maybe a solution that you can random uniform scale

Sometimes you need complete random x-y-z
Or uniform resize x&y or xyz or yz

if you move your object you get another random value this is maybe nice for animation but not if you need the same random look ,

Maybe refresh random node all the time or just one time and keep the same value

Can this be done in the future ?

image

Can't install v2.1 on Blender 2.80.

Downloaded v2.1 zip and tried to install it as Blender 2.80 add-on. Didn't get any errors, but Sorcar is not showing in the add-on list and there is no "Node Editor" to open. Did I miss any steps? Thanks!

New math operation : need some correction

New math operation works fine except if you use 0 : for example i you want to drive the radius/size from a cube and if you use 0+0 then you get no output but the user think now i have a cube with radius 0 but instead he get a cube with the default radius off 1
The same with - substract or multiply
image
image
image

Vectorization / Multiple Values does not work?

I continue to explore Sorcar now that I have time. I still have issue in how to generate multiple values like to generate random offset poke or extrude. It should be logical, but still unsure how to go about doing this?

Screen Shot 2019-07-29 at 9 36 27 pm

I use Sverchok a lot and got used to be able to just: Generate Random Values in Range, etc and then plug it into the next node.

Do we actually need Loop in order to generate Multiple Values?

Refresh Mesh Output gives error, and no output mesh

This is a really weird error or bug that preventing me to use Sorcar (previously ProcGenMod).

I am using Mac and this has been quite bugging me since last time. I remember having this bug and none work and so I gave up. And today I decided to look this add-on again and pretty impressed by what it has become with all new nodes etc.

HOWEVER, I just wanted to make and output a mesh with Refresh Mesh Output node and nothing happen, instead I am getting this error:

Screen Shot 2019-06-28 at 15 16 53

Am I doing anything wrong?

Traceback (most recent call last):
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/Sorcar-master/__init__.py", line 501, in execute
    node.execute()
AttributeError: 'ShaderNodeCombineXYZ' object has no attribute 'execute'

location: <unknown location>:-1

Random Error Message 2, No Output Mesh

Keep getting this... and no mesh generated. I think the refresh mesh has issue.

Traceback (most recent call last):
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/ProcGenMod-master-2/__init__.py", line 434, in execute
    node.execute()
AttributeError: 'ShaderNodeCombineXYZ' object has no attribute 'execute'

location: <unknown location>:-1

Introductory tutorials for beginners.

Hello. Sorry if this is not the right place to ask this type of question. Please let me know if there's a more appropriate venue.

I just started playing with this add-on and it seems very promising. Are there any plans to create some introductory tutorials for beginners? The videos linked to in the description are very impressive in showing what sorcar can do, but it would be nice to see how to build those node trees from scratch.

New Color connection some off them use the same colors

Some node nodes from the new system use the same color connection points , this is verry difficult to understand

for example normally you use white to white & black to black etc... but with the red input or output there are different options , the user have no idea or indication if this is correct or not .

Maybe better to use the same color for value another color for Swith ON/OFF etc....

image

Memory Usage

I've noticed that the memory usage just keeps going up and up and does not get freed if you change the seed value on a select random node. The memory does not go down if you delete the object either. You have to restart blender to free up memory.

Sorcar not installing / Linux

ProcGenMod installs and shows up in the node list.

Removed ProcGenMod. Saved. Restarted.

Installed Sorcar. Not showing up in the node list.

Removed Sorcar. Reinstalled ProcGenMod. Showed up in the node list.

Connection Points to better organize the Nodes

I think with the addon wrangler you can make some extra connection points , this can be a good idea for in the future to better organize the nodes

Group nodes etc... Not importent for the moment , but maybe for the future

See basic example :
image

Thanks for the new update for the boolean modifier node works fine .

Select Nth does not really select

When I am using Select Nth, with previous node deselecting all, I am getting error.

Apparently I need to Select All Face beforehand, before being able to select Nth. Is this by design?

Screen Shot 2019-04-30 at 14 47 31

How can i remove doubles

Basic idea : but can find a component to remove the double vertices : is there maybe a easy solution for in the future ?

image

Node Frame First Time ... what? Random error no Output.

Keep getting this error when I click on Refresh Mesh (Mesh Output)

Traceback (most recent call last):
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/ProcGenMod-master-2/__init__.py", line 377, in execute
    node.first_time = True
AttributeError: 'NodeFrame' object has no attribute 'first_time'

location: <unknown location>:-1

Cannot get any output 😔 never happened before.

ProcGenMod is clashing with Sverchok "search"

Not sure how this can be handled, you might need to talk to SV developers.

But I found that your ProcGenMod is clashing with Sverchok Search.

Traceback (most recent call last):
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master-6/utils/sv_extra_search.py", line 165, in invoke
    loop['results'] = gather_items()
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master-6/utils/sv_extra_search.py", line 108, in gather_items
    fx.append((str(idx), ensure_valid_show_string(item), '', idx))
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/sverchok-master-6/utils/sv_extra_search.py", line 66, in ensure_valid_show_string
    description = nodetype.bl_rna.get_shorthand()
AttributeError: 'Node' object has no attribute 'get_shorthand'

location: <unknown location>:-1

Also on the other hand, ProcGenMod "search" does not work on Blender version 2.79 latest.

Boolean modifier

Boolean works fine , only one problem if you change the size from the other object then you must always reselect the booleon object names etc...:

Is there maybe a better solution for in the future

image

Cannot install this addon now.... 😔

Error message:

Traceback (most recent call last):
  File "/Users/jimmyg/Downloads/blender-2.79.0-git20181004.9a674a749b1-x86_64/blender.app/Contents/Resources/2.79/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/ProcGenMod-master-4/__init__.py", line 23, in <module>
    class PcgPreferences(bpy.types.AddonPreferences):
  File "/Users/jimmyg/Library/Application Support/Blender/2.79/scripts/addons/ProcGenMod-master-4/__init__.py", line 26, in PcgPreferences
    prop_addon_location = StringProperty(name="Addon Location", default=getenv("APPDATA")+"/Blender Foundation/Blender/2.79/scripts/addons/ProcGenMod-master/__init__.py", description="DO NOT change unless the addon is installed in a different location")
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'


Request : Shading Smooth

Shading smooth can this be done inside the node editor , because if you change some off the settings it switch back to flat shading .

image

To control SC node using SV node?

Screen Shot 2019-07-30 at 12 22 48 pm

I am doing a test where I am using SVerchok node to control SorCar. Apparentlhy Sorcar does not seem to it when attribute value is changing from outside and somewhat I am getting an error, no mesh output and everything break.

I have not tested with Drivers or animation to contor Sorcar, but with above setup I am doing why is it Sorcar failed in generating and updating the mesh?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.