Comments (19)
here material
refers to a string in this node self.material
row.prop_search(self, 'material', bpy.data, 'materials', text='', icon='MATERIAL_DATA')
if there are materials in the .blend this finds them, selecting one will assign the material name to self.material
from animation_nodes.
oh that Looks extremly useful. I didn't know this prop_search thing
thanks :)
from animation_nodes.
There's plenty of nuggets like this in Sverchok, but I understand if you want to figure stuff out by yourself.
from animation_nodes.
I will figure them out myself but if you have tips, feel free to share them :D
I dont now if you took a look at my code. Maybe you have some ideas how I can imrove my style or so.
I think you have way more experience than me :)
from animation_nodes.
I'll read your code base carefully, so far it looks nice and clean.
from animation_nodes.
but a great talk to absorb is: http://www.youtube.com/watch?v=OSGv2VnC0go
( Transforming Code into Beautiful, Idiomatic Python ) by Raymon Hettinger
from animation_nodes.
Thanks for this link. Will watch this after my driving lesson :D
I often searched such videos but rarely found something really useful.
Then I bought the book 'clean code' and I like it a lot. Very helpful tips in there
from animation_nodes.
thanks again :D pretty interesting stuff shown in this talk.
from animation_nodes.
Use a pep8 checker or pep-8 auto-formatter. First you will battle with it for a little, then you will see they are quite handy. What do you code in? Sublime? Vim? Gedit?
Avoid using variable names object
and list
, because they are builtin function names . Also they aren't helping you describe the content of the variable.
see: subheading "Avoiding dots"
Reduce the amount of dot
chained lookups, especially in tight loops for speed.
This is what you do when you use aliasing too,
objects = bpy.data.objects
obj = objects['Cube']
If you can alias something once, before a tight loop that can help improve efficieny. Frequent access to objects
is faster than the full path bpy.data.objects
.
Aesthetically I like to push this into most things with dots
. If you use bpy.props.FloatProperty
3 times, import it as from bpy.props import FloatProperty
once at the top. If you need a whole collection of them do
from bpy.props import (
FloatProperty, StringProperty, IntProperty, EnumProperty
)
yes this makes the import list a bit longer, but I defend that by saying we don't spend much time looking at the import list. But I must admit this is more style than anything, because these properties are generally only made explicit in the class body. If you have many many property definitions then you will want to import them first else you get a wall of text
from animation_nodes.
addendum: http://www.youtube.com/watch?v=DJtef410XaM (The Clean Architecture in Python : Brandon Rhodes) you will also learn a few things from Mr Rhodes.
from animation_nodes.
I'm currently coding in Notepad++
Okay, will Keep that in mind that I shouldn't use the function names as variables. makes totally sense
Most of the time I already try to avoid dots, but you are right. I never imported FloatProperty , etc before using it.
I will Change that after the my current Project. I try to write something like another little Interpreter that generates a string that I can compile at runtime and then I want to run this on every Frame Change or so.
from animation_nodes.
most of bpy is a massive dict
. (or behaves like a dict) . look up the .get()
method for dicts, it will return a None
if the key isn't present, you can also pass a fallback values .get(somekey, somefallback)
from animation_nodes.
jep. I used this get method multiple time already.
Yeahh. it works.
from animation_nodes.
https://github.com/JacquesLucke/animation-nodes/blob/master/mn_cache.py#L14-L18
from animation_nodes.
okay. your right :D
But I removed this file in my local branch.
from animation_nodes.
i'll fork (soon) and experiment too, there are things i'd like to try that don't make sense to implement Sverchok at this point
from animation_nodes.
for example?
from animation_nodes.
various easing functions
from animation_nodes.
okay cool
I have 360 nodes running at 20 fps. I think thats quite good
from animation_nodes.
Related Issues (20)
- Animation Nodes can't process after error HOT 6
- from . lists.base_lists import , there is no base_lists.pyx file in the directory. HOT 4
- I tried to compile a single file my_wiggle_falloff.pyx based on wiggle_falloff.pyx, and it pops up an error relative cimport beyong main package is not allowed. Below is the setup.py. Is it possible to compile a single file rather than the whole package? HOT 10
- problems with blender 3.4.0 HOT 3
- Animation node rename install error HOT 9
- How to use convert time_info into python to add animation? HOT 6
- Geometry Node does not evaluate for AN-instanced objects HOT 2
- Animation nodes for blender 3.3.1 HOT 7
- Animation node values not updated on render animation HOT 1
- Unable to install Animation nodes in Blender 3.4.1 on Ubuntu 20.04 with Python 3.10.8 HOT 1
- Viewer Issue HOT 6
- Strange Behavior of Distribute Matrices (or Bug in Transform Vector?) HOT 1
- Error please help HOT 3
- Console Error when using Get Custom Attribute Node on a Mesh Input. HOT 1
- Not opening for Mac HOT 6
- Viewer does not show box with information HOT 2
- Bmesh Mesh node is not working HOT 1
- No animation nodes for 2.92 HOT 1
- Animation_Nodes nodes show up in Serpens3 when using shift+a search HOT 2
- how can i import my own .py file and use this in the script node?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animation_nodes.