text:
Get number of frames in scene from the command line?
I'd like to know if there is a command-line option (or combination, or a way!) to get the number of frames that are included in a specified blender scene; for example I'd like to use is like this:
$ blender <option> file.blend
$ Number of frames in blender scene: xxxx

This information is stored in the blend files header, so you can find out without having to load Blender at all.
This has the advantage you can scan a directory of 100's (or 1000's) of blend files in a very short time (a few seconds even if the files are large).
Blender comes with a script in scripts/modules/blend_render_info.py which can extract this data from a blend file (you don't even need Blender to be installed just a copy of this file and Python is enough).
You can load the script as a module or execute it directly.
command line example:
# python blend_render_info.py /path/to/my_test.blend
1 250 Scene

python example:
This can run inside blender,
otherwise blend_render_info.py will have to be in Python's sys.path
import blend_render_info

filepath = "/path/to/my_test.blend"
frame_start, frame_end, scene = blend_render_info.read_blend_rend_chunk(filepath)

print("total frames:", (frame_end - frame_start) + 1)

As you can see the frame range and active scene is stored, if you want more info you'll have to use a script and load the file into Blender.

The Command Line reference does not list a command to output the number frames of a scene:
https://www.blender.org/manual/advanced/command_line.html
But you can tell Blender what scene to use and to render all frames (if that is what you want):
 -a or --render-anim
     Render frames from start to end (inclusive)

 -S or --scene
     Set the active scene  for renderingame> for rendering
It probably uses the frame range as set within the .blend (Timeline).
Or is your definition of "all frames" from first keyframe to last?
In that case, you need a little script that determines the range and returns the info. A python script can be run like this:
 -P or --python
     Run the given Python script file

If you want to find the min and max keyframe of any object in a scene, you can use this:
import bpy

keyframed_ranges = {}

for scene in bpy.data.scenes:
    lower = []
    upper = []
    for ob in scene.objects:
        if (ob.animation_data is not None and
            ob.animation_data.action is not None):

            # Note: frame_range.y is frame_range_x+1 if there's just a single keyframe!

            lower.append(ob.animation_data.action.frame_range.x)
            upper.append(ob.animation_data.action.frame_range.y)

    if not lower or not upper:
        keyframed_range = scene.frame_start, scene.frame_start
    else:
        keyframed_range = min(lower), max(upper)

    keyframed_ranges[scene.name] = keyframed_range

print(keyframed_ranges)

Thanks for your reply! Well, what I want to do is to be able to determine the total frames that would be rendered (i.e. individual jpeg's) in order to split the work into multiple discrete tasks; but to do that and split my scene as evenly as possible I want to be able to know beforehand the length of the scene (total individual frames to be rendered) in order to calculate an accurate step. So I guess this would fall in the second category you mentioned.


text:
Can we use the shape of an object that is instanced to particles with dynamic paint
So the general setup here is to use an animated particle emitter set as dynamic paint brush, which will cause deformations on another object set as dynamic paint canvas. The latter object has its surface type set to Displace under the heading Dynamic Paint Advanced.  Using this basic setup, when the particles make contact with the surface, the deformation in the canvas is a sphere shape which reflects a point with a radius.
Now when another object is instanced to replace the particles using the setting Object which is found in the particle settings' Render area, the particles now show up as the object that is attached here. However, the surface deformation that takes place on the brush canvas is still sphere-shaped.
So this brings me to the question, can we make the deformations that take place on the canvas reflect the shape of the object that is replacing the particles?

AFAIK, no. You could use rigid body simulation instead if you need dynamic brush objects.

It looks like there's a lot of stuff particle instances can't do.

Dynamic Paint isn't necessary for this to be done.
Gleb Alexandrov recently posted a video showing how to use a cloth simulation to achieve damage on an object which matches the shape of the object that is colliding with it as shown here in his video Blender Tutorial: 9 Ways to Destroy Things  https://www.youtube.com/watch?v=wJFE2pb0Ri4
Fist step: add a cloth simulation to the object that you want to have a worn-down damaged look.  To have the object become squashed without bouncing around or flattening out, just set 'Bending' to 0.0

Then you add a collision simulation to the object that will be causing the damage.  I used default settings for this.

Now use the Timeline to animate the damage-causing object to overlap with the cloth simulation object that is to receive the damage.

Unfortunately, no.
As an alternative, you could try using rigid body simulation.
Note that rigid body interactions will not work as expected currently, because rigid body simulation only takes into account the base mesh (no modifiers). However, some recent improvements will soon make this possible.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Where to report and discuss UI "bugs" and inconstancies?
As UI/design inconstancies are not considered bugs (rightly so), they are off topic on the bug tracker.
Is there a place where these sorts of things can be reported and discussed?
Or a place to write issues/ideas where the new UI team will read them?

I believe this wiki page was created for that purpose.

If you have a full proposal (detailed design docs), it should be ok to open a task on http://developer.blender.org/ and discuss there (staff only!)
You can discuss with the community at http://blenderartists.org/ to generate ideas, exchange mockups and find to a practical proposal. Then it's time to write it down on a wiki page for example.
Implement the ideas or find someone who does, then submit something working (a patch/diff) to the tracker. If there's no one to actually code it, it will likely be considered a feature request and not gain much attention there are just too many and not everyone will agree on a certain solution...

Only team members are suppose to create tasks. This is to avoid an influx of tasks and such.
Instead the WIKI should be used to create a proposal. Then attention can be brought to the proposal via IRC, the BF-UI mailing list, or feel free to tweet me directly @carter2422

Updated answer, left "open a task" part in with a giant strikethrough line, to make things clear :) Thank you for your additions about the communication channels, upvoted!

The question was about inconsistency, not UI design proposal. I understand UI proposal should not be made by everyone to prevent influx, but inconsistencies are not subjective that much. Adding a new type 'inconsistency' in the bugtracker, would greatly help improve the UI. Team members are experienced users and experienced users don't see inconsistencies anymore.

Well, I guess there are two types of inconsistencies: a) slips of the pen (or rather coding fingers), where there's no doubt how to correct it (like misspellings). b) Inconsistencies by design, something not nice but unavoidable unless the groundlaying design is changed. I had the latter on mind, and these really need proper proposals how to solve the problem, not only a bug report saying it exists and that it shouldn't be like that.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Why does applying an objects matrix to a location fail?
I am trying to get global coordinates of a point for an addon I'm creating.
If an object has no transformations, the coordinates I'm grabbing work, and also if there is either a scale or a translation. Yet, any rotation transformation produces incorrect results:

Open Blender, File > Load factory settings
Hit Numpad 1 to go to front ortho view
Hit R, Z, 45 to rotate the default cube 45 degrees around z axis
Hit Tab to toggle edit mode and select the upper leftmost vert in this view
Hit Tab, Tab to toggle edit mode off and on again
Select scripting layout
Run this code in Python Console:
ob = bpy.context.object

for point in ob.data.vertices:
    if point.select:
        print(point.co * ob.matrix_world)

Press N in 3D View panel to bring up point coords, switch to Global and compare coords from python console, these are different:

From python console: Vector (0.0000, 1.4142, 1.0000)
From N panel: X: -1.41421, Y: -0.0000004, Z: 1.00000

So, what am I doing wrong? Here's my code:
class GrabPointFromActive( bpy.types.Operator ):
    bl_idname = "mct.grabpointfromactive" # Check the blender precedent here for naming
    bl_label = "Grab From Active Point"
    bl_description = "Grabs coordinates from selected vertex in edit mode"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        addonData = bpy.context.scene.mct_data
        prims = bpy.context.scene.mct_data.primList
        ob = bpy.context.object

        # fix later, only allow execution when a single vert is selected, otherwise warn
        # fix later, check if this is a mesh first before toggling, we need this so most recent active selection is used
        bpy.ops.object.editmode_toggle()
        bpy.ops.object.editmode_toggle()
        for vert in ob.data.vertices:
            if vert.select:
                prims[addonData.activeListItemIndex].point = vert.co * ob.matrix_world

        return {'FINISHED'}

When applying an objects transformation matrix to a vertex, you need to multiply:
Matrix * Vector

However your example does:
Vector * Matrix

This behavior matches numpy and other math libraries.


text:
Access python data path with ... (Ellipsis)
I am trying to access a bool property in the python API to see if an option is enabled or not. The python tooltip for the option says this:
bpy.data.screens['Default']...show_grease_pencil

I try to use that in the console or in py scripts, and it says the ellipsis(...) is invalid syntax. What am I missing? (Ignore the tooltip text. I originally thought the '...' was just hiding some of the API). I tried it with double quotes and that didn't help.

I have to say this quirk really slows me down when I'm exploring new corners of the python API.  Just today I was up to my armpits in drivers and the tooltip just told me bpy.data.objects["Armature"]...type .  After a great deal of flailing about in the python console i was able to figure out that it was bpy.data.objects["Armature"].animation_data.drivers[0].driver.variables[0].type .  I look forward to the day when the tooltips save me an hour of fumbling in the dark.

It is a quirk of Blender's current UI, but actually you can deduce its location a bit, helped by Blender's API documentation.
Direct Access
The property you're looking for is SpaceView3D.show_grease_pencil, that one is clear. Now, what class contains a Space (SpaceView3D's ancestor)? Scroll down to References section in that class' docs. One of references there leads to Area.spaces. This is easy, because one of its docs' Reference leads to Screen.areas, and Screen is the type of what's visible before the ellipsis. So the attribute's full path is:
bpy.data.screens['Default'].areas[X].spaces[Y].show_grease_pencil

... where X depends on the screen's subdivision, and Y is 0 if the 3D View is visible in that area. You can find that out from Console:

Using Context
It's easier to read 3D View space's settings through bpy.context, e.g.:

Use bpy.context.space_data, if the 3D View area is active (i.e. accessed through an operator executed from the 3D View itself).
Use bpy.context.area.spaces[1], if accessed through a Console whose display type is directly switched from a 3D View.
Use bpy.context.screen.areas[X].spaces[0] if accessed through a Console in another area, index X must be searched beforehand.

The same show_grease_pencil attribute is accessible through these different paths.

Great explanation. Thank you. It can be confusing since there is an operator called ... that I thought it was referencing somehow.


text:
How to make an animation / armature remember poses?
I rigged a character and I can render stills, but I can't make an animation. How to make Blender "know" that I want the arm - as an example - go from up to down?
I tried to move my character arms down, than changed the current frame to 1 and moved it up a little. Than I went to frame 2 and moved it up a bit more and repeated this until frame 20. When I went back to frame 0, it stayed as I left it in frame 20, so I guess I'm not doing it right.
How to "remember" the poses?

You need to set keyframes after posing the character. With the posed object selected hit I and set the appropriate keyframe, e.g LocRot (for location and rotation). You need to do this before you move onto the next frame.
Frames that have keyframes on them are highlighted with an orange line in the timeline. If you don't see the keyframe before moving on, your changes will be lost for that frame and you will have to redo it.

You may want to enable Auto Keyframing (Docs) to automatically insert keyframes as you pose your armature:

thx ill try to do that soon ;D

Also, make sure you have all the bones you changed selected when you keyframe them.  I just made that mistake of only keyframing the last one I selected.


text:
Copy material to another object?
I saw a video where the person copied a material from one object to another (Cycles).
How can I accomplish this?

Select all target objects and also the source object (the source object needs to be active, so either select it last or select it again after you selected all target objects).
Go to the Material tab, select a material slot and click the specials menu button.
Click Copy Material to Others to copy.

@CoDEmanX I used your suggestion & it worked but... How do I select an object if I've got all selected? becuase if I right click it, it unsellects all others. I've used Shit + right, but in the video I saw, he uses just right. Besides, why Copy Material to othe doesnt appear when I press space bar in 3D view (in the video it appears). Maybe it's the version (I'm using 2.72 & the video 2.65). Thanks.

It's Shift + RMB in vanilla Blender, either once or twice (selected object but not active > selected and active > unselected > selected and active > ...). Copy Material to Others does not appear in spacebar menu, because it is flagged internal, see operator definition.

To access the menu shown in the image, on the far right side of the materials list, click the "down arrow" underneath the + and - symbols.

Where is this option in Blender 3.x?

@AaronFranke Still in the Material tab, in the menu with the down arrow, but now called Copy Material to Selected

How can I "share" a material? If I copy and then set the same name, it just appends ".001" to the name.

If you want to use the same material, just select it from the list of materials (click the button in front of the material name to open the dropdown list). Copy Material/Paste Material copies the material settings. Copy Material to Selected applies the active object's list of materials to the other selected objects, replacing their material slots but reusing the existing materials without duplicating them. The titles and descriptions of the operations are not great.

You can also do this by pressing CtrlL> Materials with the target objects selected and the object with the source materials active. You can select multiple objects at once with ShiftRMB.

That is the way to copy (actually link) lots of materials or modifiers to other objects at once.

Actually this is all wrong. So wrong on so many different places because blender tuts obviously don't know the meaning of the word copy^^. A copy is a copy and not a reference!
You are creating references (at least it does that in my version 2.79).
if i change a material of one object, the other objects are changing too. This is not quite what I want and what your title actually says ;)
I just looked further and can tell anyone who wants to actually copy it how it's done.
You actually follow above steps. So:

Shift-RightClick all objects you want to have the same material too
You Shift-RighClick the object that has the material already last
In the Material Tab you do as above and click on this special button (below the plus and minus buttons right side of material name)
Now all have the same appearance.
Select an object you might want the material to be slightly different
Now there's the name of the material twice. One time in the list and a second in an "input" field. Next to that input field is a button labeled "2" and another one with "F". Next to that is another "+" button. If you push that one it makes a copy of the reference and you can edit this material without having any impact on the other objects mats ;)

Hope I wrote it as clearly as possible =)

Nothing is wrong with answers, this is more about word usage. There isn't term "reference" for material in Blender in this context but result of Copy Material To Others is like linking materials generally. Unlinking is very well documented here https://blender.stackexchange.com/questions/23386/how-to-put-a-unique-material-on-duplicated-objects-separately

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Why do some bones in my armature disappear when I go into Edit mode?
I made a rig for a model of a dragon and for some reason,
when I go into Edit Mode, some of the bones disappear:

I don't know if this is relevant or not, but I created the rig using the standard release of 2.69, but now I'm using the standard version of 2.70.
Here is my blend file.

@CoDEmanX Is this really a feature or is it a bug? It seems more like a bug that was mistaken for a feature to me. Do you know for sure?

ALT + H  did not work for me.
I used "/" on the numpad instead and that worked.

Welcome to bse, Augi.  "/" on the numpad is local mode toggle, and has nothing to do with hiding / un-hiding bones.

Well, explain to me why ALT + H did not work and why "/" worked?
Doesn't matter what it's "intended" for, what matters is it helped me solve my problem and I shared it in hopes of helping someone else who runs into a similar issue.

I dont understand it either. Alt H should work. Same problem and / worked for me too. Alt H didnt.

It does matter what the tool is intended for. Alt+H and Numpad / do entirely different functions.

Alt + H did not work for me and "/" solved my problem.
That is all I know.

If I had the reputation, I would post it as a separate answer.
My issue was layers. I had an IK bone on one layer, and the rest of my armature in the other.
I won't pretend to understand all of it, but this link helped me: https://docs.blender.org/manual/en/2.79/editors/3dview/object/properties/relations/layers.html
Activating the layer, selecting the object, then moving the object back to the original layer with "M" fixed it.


text:
How can I reverse the direction of bones in my armature?
I spent a lot of time building up my armature for my dragon model and then, after I was all done and started to refine it, I realized that the bones from the pelvis out to the end of the tail were pointing the wrong way - they need to have their heads pointing the other direction:

I don't want to have to delete these bones and start over.
Is there an easy way to switch the direction of the tail bones?

Switch Direction of Bones
Thankfully Blender has a simple command that will reverse the direction of selected bones called "Switch Direction". You can access this two different ways:

Select rig > Tab > select bones > Specials menu (W) > Switch Direction
Select rig > Tab > select bones > 3D View Header > Armature menu > Switch Direction

I wouldn't say its hard to find, its in the Armature menu.

Thank you for pointing that out! I had been looking for something to "Reverse direction" ("Switch" never occurred to me) and I was also looking for a Bones menu item in Armature, i.e. Armature -> Bones -> Reverse Direction.

For Blender 2.8x the shortcut is now Alt + F

Blender has a function to switch the direction of Bones, however its worth noting that there is also the ability to select a bone chain in one step:

Enter Edit Mode Tab
Select a bone on either end of the chain you want to flip RMB
Hold Ctrl and click RMB to select the other bone in the chain.(this selects bones in between, matching similar behavior in mesh editmode)
Armature menu > Switch Direction (or AltF)

authors: Евгений Гейзер


text:
How do I connect a bone to another bone via python script
I'm trying to make a chain of "segments", meaning I have 3 bones in a setup and I'd like to replicate them along the z-axis. I use a for loop to duplicate the entire armature, my object and then rename the bones of each segment. Which works best for vertex groups assignment.
I then use CtrlJ to join the meshes as well as the armatures. When I go into Edit Mode for the mesh, I can just use Remove Doubles to connect the pieces, but here is my problem:
When I join the armatures, I have a chain of bones that are not parented, so I was trying to find a method that does something like this:
for bone in arm.pose.bones:
  i += 1
  bone[i].parent = bone[i-1]

(pseudocode, but I hope you know what I mean)
But bone parent is read-only and the ops.pose.parent_set() only works if there is an active bone, but I could not figure out how to change the active bone. bone.select seems to always be True, so I'm not entirely sure how to us the ops. I hope there is a better way, like with objects, where you can just assign your parent object/bone.

Parenting is done in edit mode where you setup the armature.
arm.pose.bones already indicates it is related to posing bones.
Try:
arm.data.edit_bones['yourBone'].parent = arm.data.edit_bones['parentBone']

Thanks for your quick reply, I didn't get that edit_bones was a collection, I thought it was a method and didn't look into it deep enough, so thanks.


text:
Video Sequence Editor: change all data/files paths with python
I want to create a short animation from a series of png image files rendered in another animation program with VSE. I add the effect strip Alpha Under with several transparent overlays PNG files that contain title information, watermark and logo to achieve the desired look. This structure works well and gives the desired result.
I have to repeat this process for a twenty different animations. The number of images imported is always the same, and they are always the same x and y dimension, just different in appearance with unique titles overlays. I would like to use Python to update the data/files paths for all of the assets used as inputs to the VSE, and update the animation output directory.
I am pretty new to Python, but have coded in C++ in the distant past. I am unsure how to programatically select a track in the VSE and bpy.ops.sequencer.change_path() and bpy.ops.sequencer.reload() to update the VSE structure.

Related: http://blender.stackexchange.com/a/41750/2843. And maybe helpful: http://blender.stackexchange.com/a/41747/2843 (I add Strips via Python in this Script automatically...).

So far all I have is
import bpy

scn = bpy.context.scene
x = scn.sequence_editor.sequences.new_image("bacon", "/var/tmp/blender/unit-blocks-s2/0001.png", 3, 1)
print(x)
for i in range(2,200):
    x.elements.append("%04d.png" % i)

au = scn.sequence_editor.sequences.new_effect("eggs", 'TRANSFORM', 4, 1, len(x.elements), x)
au.update()

print(au)

The 'ALPHA_UNDER' effect strip requires two input strips, and I'm not sure what the second one would be in your project.
Is this enough to get you started?  Feel free to comment on this answer or refine your question.

There are many great VSE add ons that you could look at for inspiration. Also consider reducing your complexity. Perhaps you could create sub scenes, each containing the png sequence you need. then you could iterate those scene strips in your master VSE scene.
After setting up a repetition of the strip stacks (in the master scene) you could make a simple command line render of the master scene with an array for start / end frames to give you discreet composited renders.

Need some clarification.

Create scene "sub scene 1" each for composition
Duplicate "Full copy" scene "sub scene 2"
Replace sequence fottage in "sub scene 2"
Repeat for required number of sub-scenes
Master scene step !! ?
Can you pls detail out the process you mentioned please


text:
2.8 Adaptive Subdivision
How can I enable adaptive subdivision in Blender 2.8? I have a noise texture plugged into the displacement output for a material, with the displacement method set to Displacement Only. There is no "adaptive" option for my subdivision surface modifier, however, when I increase the subdivision levels manually, the mesh is displaced in the rendered view.
I am rendering with cycles with the 2.8 beta version downloaded today.

Make sure you're in experimental mode!

How do I enable that in 2.8?

Here are the steps:

Select Cycles for Render Engine
Select Experimental for Feature Set
Select Dicing Rate and Preview count in Subdivision drop down
Select Subdivision Modifier from Modifiers tab but do not apply it
Check Adaptive check box and choose dicing scale
Done!

I hope that helps

Do NOT apply the modifier.

@L0Lock thanks. Forgot about that. Corrected the same.

How do I enable experimental mode in Blender 2.8?

The button is no longer in the same place it was in 2.79

Modified the answer. I'm also commenting because I'm not sure whether you get a notification whenever an answer is edited or not.

Also note: subdivision Adaptive is only available when this modifier is at the bottom of the stack!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Why do I get weird rotations in exported FBX?
I have a simple, extruded cube model with two bones assigned to it. Now, when I export the model to FBX, the bones get weird rotations. I've checked that the bones have XYZ rotation of (0, 0, 0) in Blender, but for example the root bone has a rotation of (90, -90, 0) and the child bone has a rotation of (-180, 0, 0). The armature has a rotation of (-90, 0, 0) which I kind of expect to be there (as far as I know it's because of the axis conversion).
So, where are these rotations coming from?

Try applying the rotation of the object using CTRL-A > Rotation.

I personally have similar problems when importing an FBX into Maya (exported from blender).
In Maya 2009 everything worked fine, but in 2013 and later (possibly before that even) I have to rotate everything by -90 degrees on the Z axis. It might be possible to avoid this using settings in the exporter, but I've had no luck with that.
If it is indeed Maya that you're using, just select everything (including things that look like they're rotated fine) and run:
rotate -r -os 0 0 -90
Put that on your shelf if you like, you'll probably be using it a lot.

When exporting, different formats have different space formats. Usually it's just a case of the axis getting mixed up.
There's some help here, but generally I'd suggest skipping exports if possible.


text:
Color of spline in 3d view
Is there a way to change the color of a curve object in 3D view?
(change the black lines only for this object to green).
I've got over 1000 curves generated by a python script and would like to change their color depending on length.

My suggestion would be to:

Increase the bevel Depth value of the curve on the curve properties to give thickness to the curve
Make sure the Fill type for the curve is set to Full instead of half. So that the curve is a cylinder instead of a half cylinder. (Increase bevel Resolution for a smoother curve profile)
Assign separate materials with different colours to each curve. The curve now has a thickness so that materials can be displayed.

You should be able to incorporate the steps above into your script:
Something like the image below can be achieved:

Of course, a disadvantage may be that this only works for Object Mode and not Edit Mode.

@Aldrik If you are going to make such changes to an answer that the answer is now using a different technique then I suggest you provide your own answer. I have rolled back to my original answer.

I'm aware, but considered it a minor enhancement. ;)

As long as the patch that LeonCheung mentioned isn't implemented I'll use this and the answer from gandalf3. Thanks all together.

Update: This answer is now obsolete based on OP's comments below.
Go to File >User Preferences >Themes and click on the 'Wire' swatch. You can change this to any color. If you want to change the color in Edit Mode then use the 'Wire Edit' swatch.
Note: Both of these also change the color of objects in Wireframe Mode.

This changes the color for all curves. But I want to change just a single curve or several curves in different colors

As far as I know, you can't apply a color (Material) to a curve object.

@Germar If you want this purely for identification purposes, then you can display the name by going to the Properties panel >Object >Display and check the Name box.

I've >1000 curves and would like to color them depending on its length during they get created by my python script. Thanks for your help.

I bet you are looking for things like this:[https://projects.blender.org/tracker/?func=detail&atid=127&aid=33817&group_id=9]  or this: [http://blenderartists.org/forum/showthread.php?254243-Viewport-FX/page9]
I miss it too. I remember there was a very very old addon that can make this happen (for 2.5x), but I have to admit it cannot be done currently, except some coding work by yourself or others.

@LeonCheung yes thats what I'm looking for. So I hope that it will be implemented soon.

The question lacked detail when I wrote this answer. Now the answer is obsolete - I won't delete it because there are important comments.

If your curves are just for visualization, you could draw them using bgl.
import math
import bpy
from bpy_extras.view3d_utils import location_3d_to_region_2d
from bgl import glEnable, glDisable, glBegin, glEnd, glVertex2f, glColor4f, \
glLineWidth, GL_LINE_STRIP, GL_LINE_STIPPLE, GL_BLEND

class ExampleLines(bpy.types.Operator):
    bl_idname = "view3d.bgl_example"
    bl_label = "Example drawing lines in 3D View"

    def invoke(self, context, event):
        area = context.area
        if context.area.type  == "VIEW_3D":
            region = context.region
            self._handle = region.callback_add(self.draw_callback, (context,), "POST_PIXEL")
            area.tag_redraw()
            return {"FINISHED"}
        return {"CANCELLED"}

    def draw_callback(self, context):
        region = context.region
        region_data = context.region_data
        current_frame = context.scene.frame_current

        glEnable(GL_BLEND)
        glLineWidth(2)

        glColor4f(1, 0, 0, 0.5)
        glBegin(GL_LINE_STRIP)
        for i in range(current_frame):
            glVertex2f(*location_3d_to_region_2d(region, region_data, (math.sin(i / 10), 0, i / 10)).to_tuple())
        glEnd()

        glColor4f(0, 1, 0, 0.5)
        glBegin(GL_LINE_STRIP)
        for i in range(current_frame):
            glVertex2f(*location_3d_to_region_2d(region, region_data, (0, -1 + math.cos(i / 10), i / 10)).to_tuple())
        glEnd()

        glColor4f(0, 0, 1, 0.5)
        glBegin(GL_LINE_STRIP)
        for i in range(current_frame):
            glVertex2f(*location_3d_to_region_2d(region, region_data, (0, math.sqrt(i / 10), i / 10)).to_tuple())
        glEnd()

        glDisable(GL_BLEND)

        # restore opengl defaults
        glColor4f(0.0, 0.0, 0.0, 1.0)
        glLineWidth(1)
        glDisable(GL_LINE_STIPPLE)

bpy.utils.register_class(ExampleLines)

Nice! But I rather want to keep them as objects so I can highlight and manipulate them. And the bevel_depth method doesn't slow down the viewport that bad as I assumed before.

In addition to Ray Mairlot's answer of making materials with different colors, you can use the viewport drawing color settings: (Still requires materials, and still requires a bevel on the curve to be seen)

Blender Internal:
Create a material and enable Object Color:

Now you can change the color in Object panel > Display > Object color

Cycles:
Create a Materiel and adjust the Viewport color:

An advantage to this is it works for Cycles and without changing the rendered view. (Object Color does effect the render in BI though)

In Blender 2.8 you can go Edit > Preferences > Themes > 3D Viewport > Wire Edit and change the color there.


text:
General system specs for large scenes in blender
What are the system requirements for working with complex geometry in Blender? Things like RAM, GPU, CPU etc.?

Welcome to Blender.SE. Hardware related questions are generally considered off-topic. Also your question is a bit vague. What would you call a 'large scene'?

Blender's website has a page dedicated to this, it is now dated a few years but is still useful (was updated for 2.6).
http://archive.blender.org/features-gallery/requirements/index.html
If you are considering building a PC for 3D, anything from Average and up should suffice for fairly complex scenes.

Minimal specs for Hardware

32 bits, Dual Core CPU with at least 2 GHZ, and SSE2 support.
2 GB RAM
24 bits 1280x768 display
Mouse or trackpad
OpenGL Graphics Card with 256 MB RAM

Average specs for Hardware

64 bits, Quad Core CPU
8 GB RAM
Full HD Display with 24 bit color
Mouse or trackpad
OpenGL Graphics Card with 1 GB RAM

Production specs for Hardware

64 bits, Dual 8 Core CPU
16 GB RAM
Two times Full HD Display with 24 bit color
Mouse + tablet
Dual OpenGL Graphics Cards, quality brand with 3 GB RAM

Also related: What are the best graphics cards for cycles? and How important is a GPU for modeling?


text:
How to create a curved surface from a sharp edge?
Sorry for the basic question, but I have been working on this all morning and can get a basic curve but I keep falling short of what I really want.
I am in the process of making a urban street model (square sections), the first section went very quickly, just a street plane, 20x20cm curb, a sidewalk raised 20cm off the street.
When I moved on to the intersection section, street with 4 round corners with the curb then the sidewalk and be precise enough to have it tile up against the plain street section, I just ran into my modeling limitations.
1st I tried a Bezier Curve, a 20x20x20cm box with array and curve modifiers. I could only get it to work if I did it in the center of a new scene with a fixed count (fit curve did not work). If I applied the modifiers there was all this extra geometry and ending did not seem precise.
2nd I scrapped the curb and just extruded a vertex and used the spin tool for the curve, this worked but now I need to work the curb into the texture of the sidewalk. This worked and not sure if i'm just making things more complex then then need to be.
I wanted a 90 degree curve that fits in a 2mx2m square, one curve that is the 20cmx20cm curb and another right behind it that is the sidewalk.

Could you perhaps try to draw a quick sketch of how this should look and upload the image, just basic lines at least in a paint program.. that might better help us visualize what you want.

to get Fit curve to work, you can try applying the scale of the objects (Ctrl+A)

It is a bit difficult to visualize exactly what you actually want based on your wording of the problem but If I understand the problem correctly, what you want is a curved surface. You can achieve this by just bevelling a sharp edge,
You can take a sharp corner that connects at a 90° angle…

…and then bevel the edge using Ctrl + B and increase the segments to round it into a curved surface.

From what I can understand of your question, this is one way to do it. (as already mentioned by iKlsR)
if you don't need the curb and the sidewalk to be separate objects, you can get this by Beveling (CtrlB and use the mouse wheel to adjust the number of segments.):

If they do need to be separate objects, you can do this by

Add a circle and delete three quarters of it:

set your Pivot point to 3D cursor (.) , E extrude, and Sscale.

(instead of using the 3D cursor, you can also just use AltS to scale along the normals)
To create the sidewalk, duplicate the object (in object mode) and scale it down, then go into edit mode and press AltM > Merge at Cursor

instead of extruding, i added 2 circles one at 2m and one at 2.4m, then added a face to the top

@stephen it would be nice if you write an answer detailing your method.


text:
Run an edit-mode operator on every object in the scene
I want to untriangulate every object in my scene with this script:
import bpy

for ob in bpy.data.objects:
    bpy.ops.mesh.tris_convert_to_quads(limit=0.9, uvs=False, vcols=False, sharp=False, materials=False)

But it doesn't work in object mode, any ideas on how I can get it working?

There are 2 ways you can do this:

Standard API (bpy) - the most straightforward is to set each object in editmode and run the tool.

Notice I'm not using bpy.data.objects, This will operate on all objects in your blend file, not just your scene, instead use bpy.context.scene.objects.
import bpy

scene = bpy.context.scene
for ob in scene.objects:
    if ob.type == 'MESH':
        scene.objects.active = ob
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)

        bpy.ops.mesh.reveal()
        bpy.ops.mesh.select_all(action='SELECT')

        # execute any editmode tool
        bpy.ops.mesh.tris_convert_to_quads(limit=0.9,
                                           uvs=False,
                                           vcols=False,
                                           sharp=False,
                                           materials=False)

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

Note:
You need to be careful trying to edit all objects, some may be hidden, not on a visible layer, or linked in from an external file (and can't be edited). For this reason its often better to use context.selected_editable_objects

bmesh module (Docs) - bypass bpy.ops modes and edit the mesh directly.
In this case using the bmesh api. Note that this is specific to meshes, curves, metaballs etc will need to use bpy.ops still since they don't have an equivalent to bmesh.
import bpy
import bmesh

scene = bpy.context.scene
for ob in scene.objects:
    if ob.type == 'MESH':
        me = ob.data
        bm = bmesh.new()
        bm.from_mesh(me)

        # execute any bmesh operator
        bmesh.ops.join_triangles(bm, faces=bm.faces,
                                 limit=0.9,
                                 cmp_sharp=False,
                                 cmp_uvs=False,
                                 cmp_vcols=False,
                                 cmp_materials=False)
        bm.to_mesh(me)
        bm.free()

Note:
The examples above may touch the same mesh multiple times since many objects can share the mesh, You almost never want this, at worst it gives invalid results because the tool runs many times, at best the script just runs slowly and does a lot of useless calculation.
Here is an example which ensures meshes are only edited once.
import bpy
import bmesh

scene = bpy.context.scene
unique_meshes = set([ob.data for ob in scene.objects if ob.type == 'MESH'])

for me in unique_meshes:
    bm = bmesh.new()
    bm.from_mesh(me)

    # execute any bmesh operator
    bmesh.ops.join_triangles(bm, faces=bm.faces,
                             limit=0.9,
                             cmp_sharp=False,
                             cmp_uvs=False,
                             cmp_vcols=False,
                             cmp_materials=False)
    bm.to_mesh(me)
    bm.free()

One question though, is it best to use the bmesh API or bpy.ops? Or does it not matter?

When possible I would avoid using bpy.ops, These wrap tools in a way that relies on the context and dont have a good way to pass args and return results to scripts. If there is an alternative (as with bmesh), its better integrated into python, and you don't have to worry about active object, modes, visible layers etc.


text:
Attaching Custom Data to the blend file, scene, objects
I see many examples that attach custom properties to objects eg.
bpy.types.Object.mytype = bpy.props.StringProperty()

What are the other useful places to put custom properties. In particular I want to store a global to the blend file itself?
 len(dir(bpy.types)) # -> 3282!

I see there is a type BlendData

Only ID types, Bones and PoseBones support properties:

Custom properties can be added to any subclass of an ID, Bone and PoseBone.

http://www.blender.org/documentation/blender_python_api_2_70_release/bpy.props.html
The only type with just a single instance is bpy.types.WindowManager, but its properties aren't serialized to .blend.


text:
Trouble getting windowmanager properties to save it's contents with blend file
I'd like the contents of this custom editor panel to persist with the file.
I can't seem to get my PropertyGroup or even a StringProperty to save with the blend file.
class PG_mypg(bpy.types.PropertyGroup):
    custString = bpy.props.StringProperty(name="custString")

bpy.utils.register_class(PG_mypg)

# this adds it but it doesn't persist in the file
bpy.types.WindowManager.myPanelSettings = bpy.props.PointerProperty(type=PG_mypg)

# even this one doesn't save either
bpy.types.WindowManager.myCustString = bpy.props.StringProperty(name="customString")

Note that I want this to be set for my window, not per object.

Would it be possible to add an empty object type that isn't visible in the 3d view? This is how I would do it in unity3d.

Custom properties to the bpy.types.WindowManager type don't serialize to .blend
(as if options={'SKIP_SAVE'} was set).
Your options are to use

bpy.types.Scene, but you will need to chose one scene instance to store the actual properties, and if that scene is deleted, they will be gone
Serialization: serialize your data to a string and make it the text body of a new text datablock. Give the datablock a name that starts with a dot, e.g. .my-data, to hide it in the interface. It is less likely to be removed like a scene this way.
AddonPreferences or saving to a custom configuration file - if the data is relevant to not just the current .blend, but the local Blender installation

The comment about 'SKIP_SAVE' isnt really correct, SKIP_SAVE is for operators not to reuse previous settings.

I like the suggestion for AddonPreferences but it doesn't solve this problem in particular.

@ideasman42: Interesting, this isn't documented anywhere it seems. BenL: That's right, it really depends on the use case.

I'm just going to add a utility to copy or reference the data block from one scene to another. That is the hack that seems the least hacky.


text:
Need guidance for creating no dependancies between two installs of Blender
I want to have two copies of Blender on my machine that share no settings or preferences. One will be my development copy and the second on is the production version. I need them to be separate because I will be publishing my code to all the production systems and I need this process to be replicated locally for testing.
I'm asking this because I see that by default they are sharing '~/Library/Application Support/Blender/2.70/config'
They also share
'~/Library/Application Support/Blender/2.70/scripts
This is problematic because I intend to put my addons here for the production installations. Then my dev install complains there are duplicate addons.
I'd like this to be easier, especially since it will have to be replicated every upgrade to Blender.

See the wiki page on paths. You should be able to fix it by creating a config directory and a scripts directory in the portable blender directory, but it's hard to say without knowing how your two versions of blender are installed (Two self contained versions? A system version and a self contained version? Or..?)

assume the same version 2.70, for example

I'm using mac paths but I'd like to understand best practices for both windows and osx

But are you using two "portable" (self contained) installations? Or is a system installation involved too?

In osx the local config is found within the application bundle, in the finder choose Show Package Contents then open Contents and MacOS and 2.70 there should be a scripts folder there, create a config folder. Yes you need to redo this every version, I tried submitting a patch a few years ago to bring it to the same level as blender.app to make this easier but no-one could comprehend why I would want to. I now use a script to build blender that re-creates links (each compile clears the existing folder) to a startup.blend for the dev build with other copies loading from home folder.

I guess I'm not understanding the difference between "self-contained" and a system installation. I'd want my production team using system and my dev install to be self-contained.

I think I have enough information to "initialize" my dev copy too. Thanks.

At least on Windows, it is enough to create an empty folder config in Blender\2.70\.
Blender binary path is for example:
...\Blender Foundation\Blender\blender.exe
and the version-specific folder is here:
...\Blender Foundation\Blender\2.70\
Add the config folder like this:
...\Blender Foundation\Blender\2.70\config\
Blender will note the local config folder on startup and prefer it over the user dir. If you save the startup file or user settings, startup.blend and userpref.blend will be created in your local config folder. Scripts located in the user dir won't be picked up.

Can you elaborate on the addon locations? I want to use %APPDATA%/blender foundation/Blender//scripts/addons so no extra permissions are required to install. But then my dev copy picks this location up too. For the in-progress addons my dev copy points to bpy.utils.script_path_pref()

They need to be located in Blender\2.70\scripts\addons for a local installation. Or both in the user dir, and a second copy with everything locally to the binary (so it doesn't take the stuff in user dir).

the docs refer .2.70 as LOCAL via "...self-contained bundles distributed by official blender.org builds..." Is this any different than the installer from the download page?

A Blender installer might create a config folder on installation (not sure on this!), but a zipped build creates one when you first save settings, add bookmarks etc. in the user folder too... What makes a Blender copy local is apparantly the config folder being near the binary.

I was surprised. But this does work. Now I don't have to alter the production installs....until I'm using my own fork of blender.

I can confirm that this also works on Linux. (also: thanks so much! solved my http://blender.stackexchange.com/questions/48392/make-blender-unaware-of-user-system-installed-add-ons)


text:
Blender Output Options
I'm new to blender and have just built my first 3D model. I'm wondering though if there is any way to create a properly rendered output of the 3D model in a standalone file which another user could open on their computer and have the ability to move the camera (zoom, pan, rotate etc) around? Or even if not standalone just a program that creates the rendered model and allows the user to have full camera control after the object has been rendered (rather than just getting a video/image output of the model).

Unless you create a specific setup using the Game Engine where the camera has controls for this, it is not possible to do so out of the box with Blender. Also, in my opinion, it is not entirely worth the trouble doing this as there are better ways to go about it. From experience, such a setup can quickly get clunky as there are performance issues across platforms and other things you might need to take into consideration.

I would instead recommend going with a browser solution. By doing this, you only need export once to some supported mesh format such as .fbx or .obj and there are very little to no dependencies (game engine standalones tend to be a bit large), the user just needs to have a modern web browser.
See this answer and there is also p3d.in (I highly recommend this site) and Sketchfab. Example of a model on p3d.in. It also supports textures and several other rendering options.


text:
Pan or zoom in the VSE
I am trying to create some graphic matches on action (on either side of a transition, similar shapes are in the same place on the screen.
To accomplish this, I have an image with some targets which I would like to keep semi-transparent so that I can scale and move my footage underneath to precisely the right position.
I have considered pushing each clip into a separate plane on a separate screen, but I'm not sure how I would get a semi transparent overlay using this. Anyhow, it would be preferable to keep my edits within the VSE.
Any ideas?

I'm not entirely sure what your asking. Would it work to adjust the Opacity in Properties panel > edit strip?

I figured it out. Go to Add  > Effect Strip > Transform, then right click on the element that you want to transform (i.e. the x offset) and select Add Driver. Now you will be able to pan/zoom dynamically and edit this change with keyframes on the graph screen.

Not all values in the VSE can be driven with drivers. I am glad that this worked however for those values. Also there is a great addon for GUI editing of Transform values in the preview window. Check out a demo and link to script at https://www.youtube.com/watch?v=IZpnkoEkY3E

The current accepted solution will result in a lower resolution blurry image.
A better solution enable Image Offset for that video strip to have the video with a 1:1 pixel ratio (no re-scaling). Then adjust the offset X/Y and possibly add a transform effect strip to re-scale further.
Look at Rescaling in the VSE yields low resloution, blurry images.


text:
Why does my mesh flatten on the X-axis in the game engine?
I have a little lizard with a bone structure. Currently it has no animation and no game logic set. However, when pushing P, in game logic mode on the mesh, the mesh renders as a very squished version of itself, squished along the x-axis.
Also, none of the armature movements are visible, instead it's just what it was at default.

After pressing P, I get this:

Try selecting your object and your armature and pressing CTRL-A > Apply Scale.

Could you attach the blend-file.

I don't know of a way to attach files. @CharlesL Thanks, that fixed it.

@Jamil pasteall.org is a good way for files under 30MB

Select your object and press CtrlA -> Apply Scale. This will set scale of both objects to 1.0, 1.0, 1.0.
Before you applied the scale, you must have scaled the objects along the X-Axis at one point. This will change the dimensions of the object, but the scale will be something like: 5.0, 1.0, 1.0. This won't change much in the 3D view, but BGE will reset all scales to 1.0 which (as you noticed) causes issues.


text:
Is it possible to run a script from an external editor without reloading the file?
I use an external to Blender text editor (vim). I understand I can write in it and then reload file in Blender's text editor. Is there a way to run a script from external editor without this additional step?

For short or non-operator-based scripts, that's as efficient as you'll get. Currently there is no faster way than AltR-AltP to reload a plain script modified in external editor.
For longer operator-based scripts, you can use the following initial steps:

Convert the script to an add-on, by adding proper bl_info dictionary and turning your main code into operators (can be made faster by using a template).
Create a symbolic link of the script or its development path to Blender's alternate script path (set through User Preferences > File > Scripts). That way, it stays registered on Blender upgrade, and your development folder stays organized.
If your OS or filesystem doesn't support symbolic link, move the script to the alternate script path and develop from there.
Register the add-on.

After that, the script can be updated just by pressing F8 Reload Scripts in Blender. Longer preparation, faster in the long run.

You can run an external file directly from the text editor without having to continuously reload by using a stub, This is nothing special or Blender spesific.
Blender comes with a template for a stub.
From the text editor select:
Templates -> Python -> Script Stub
# This stub runs a python script relative to the currently open
# blend file, useful when editing scripts externally.

import bpy
import os

# Use your own script name here:
filename = "my_script.py"

filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename)
global_namespace = {"__file__": filepath, "__name__": "__main__"}
with open(filepath, 'rb') as file:
    exec(compile(file.read(), filepath, 'exec'), global_namespace)

In this example filepath is set relative to the currently open blend-file. However you could set filepath to an absolute location.

Note that you can also load external scripts by importing them as modules, however this means the scripts need to be in Python's module search path (sys.path), in some cases its nicer to be able to run a script from any location on your file-system.

You can also set up a wrapper script that reload the external Python file you are editing:
Text file inside Blender:
import importlib
import myModule

importlib.reload(myModule)
myModule.runMyCode()

This way, every time you press Alt+P to run this script, it will automatically reload the latest version of the code from MyModule.

I recently wrote an addon for this task. https://github.com/s-a/ToBlender


text:
How to set cursor location, pivot_point in script?
I am trying to set a cursor location and pivot point with
bpy.types.SpaceView3D.pivot_point='CURSOR'
bpy.types.SpaceView3D.cursor_location = (0.0, 0.0, 0.0)

and I see I am not doing it right. How to do it correctly?

See Adhi's answer here as to why this won't work the way you are doing it.

Using Context
It's easier to read 3D View space's settings through bpy.context,
e.g.:

Use bpy.context.space_data, if the 3D View area is active (i.e. accessed through an operator executed from the 3D View itself).
Use bpy.context.area.spaces[1], if accessed through a Console whose display type is directly switched from a 3D View.
Use bpy.context.screen.areas[X].spaces[0] if accessed through a Console in another area, index X must be searched beforehand.

What you want to use is
bpy.context.area.spaces[1].pivot_point='CURSOR'
bpy.context.area.spaces[1].cursor_location = (0.0, 0.0, 0.0)

For the cursor location, there is a shorter alternative. All 3D View's cursor location is linked to the scene's, so it can also be accessed from bpy.context.scene:
bpy.context.scene.cursor_location = (0.0, 0.0, 0.0)

V2.8+ :
bpy.context.scene.cursor.location = (0.0, 0.0, 0.0)

what worked for me was your third example

@dimus Do you mean that the others don't work or that way is better?

I ran it from text editor, and the third example worked -- I added a 'comment-answer' with the code: http://blender.stackexchange.com/a/5361/1311

Here is a snippet of the code (forgive my bad python) which I ended up using after reading the answer
import bpy

def areas_tuple():
    res = {}
    count = 0
    for area in bpy.context.screen.areas:
        res[area.type] = count
        count += 1
    return res

areas = areas_tuple()
view3d = bpy.context.screen.areas[areas['VIEW_3D']].spaces[0]
view3d.pivot_point='CURSOR'
view3d.cursor_location = (0.0, 0.0, 0.0)

Building on dimus' answer and the accepted one further:
def area_of_type(type_name):
    for area in bpy.context.screen.areas:
        if area.type == type_name:
            return area

def get_3d_view():
    return area_of_type('VIEW_3D').spaces[0]

view3d = get_3d_view()
view3d.pivot_point='CURSOR'
view3d.cursor_location = (0.0, 0.0, 0.0)

In Blender 2.80 this should be:
bpy.context.scene.cursor.location = (0.0, 0.0, 0.0)

If you have zero or multiple number of view3d, the way to process this case is
view3ds = [area.spaces[0] for area in bpy.context.screen.areas if (area.type=="VIEW_3D")]
for view3d in view3ds:
    view3d.pivot_point='CURSOR'
    view3d.cursor_location = (0.0, 0.0, 0.0)

If you exactly know there is only one VIEW_3D by your eye, the way to process this case is
view3d = [area.spaces[0] for area in bpy.context.screen.areas if (area.type=="VIEW_3D")][0]
view3d.pivot_point='CURSOR'
view3d.cursor_location = (0.0, 0.0, 0.0)

The idea to make this simple coding way is by python's magic.
[f(x) for x in sequence if condition]

This intuition of coding method can help you to process more complicated data with simple thinking and coding.


text:
How to paint through the mesh during weight painting
More often than not when I do weight-painting, weights on a model are the same/similar through the whole mesh (for example leg, arm), but weight painting has culling which prevents paint to go through the model and affects only visible part. To rotate around mesh for painting is often less precise and is always time consuming.
How can I switch culling off and be able to paint through the whole mesh during weight paint (similar to texture paint with Tools -> ProjectPaint -> Occlude, Cull, Normal all set to Off)?

in 2.80 the solution is the options under the brush settings --> "Front Faces Only"

This has to be combined with 2D falloff.
And yes there's a typo

tested it and you are right, you think it is bug or a mistake?

Well there is a difference between Front Faces Only being activated or deactivated once 2D falloff is activated (try painting through a torus). However there is no difference between the two if 2D falloff is deactivated. I don't think it's problematic though. If you brush on back faces with 3D falloff you most likely mean to paint on them. It's just a bit misleading. Perhaps preventing it to paint on back faces all the time would be a nice addition to make it less confusing.

You can do this by deselecting Limit selection to visible from the header. You should now be able to paint through the entire mesh. It doesn't update the opposite side in realtime however as it does when painting, it updates when you release the mouse.


text:
Why does this tiny script not work in 4.0?
This script works till 3.6, but not 4.0.
import bpy

for a in bpy.context.screen.areas:
    if a.type == 'DOPESHEET_EDITOR':

        #deselect the keyframes
        bpy.ops.action.select_all({"area" : a}, action="DESELECT")
        break

4.0 says "ValueError: 1-2 args execution context is supported" in bpy.ops.action.select_all

From version 3.2, context overriding this way is deprecated and is no more available in 4.0. Have a look for instance here and this is also documented in Blender wiki here.
What you can do instead is the following:
import bpy

for a in bpy.context.screen.areas:
    if a.type == 'DOPESHEET_EDITOR':

        with bpy.context.temp_override(area=a):
            bpy.ops.action.select_all(action="DESELECT")

        break

The Python with block allows to define the life time of this temporary override (the override is finished after this block).
If you need something that is compatible with version older than 3.2, you can test Blender version using bpy.app.version.


text:
How do I test a addon without compressing?
I'm making a simple addon which has some .py files.(init, ui, operator, and so on)
Must Blender needs a compressing addon file to install?
Can I test a addon quickly from files directly, without compressing?

Yes, just place them inside your Blender version's AppData add-ons folder, unzipped.
All zipped add-ons that are installed are automatically unzipped and placed in that location anyhow.
The zipped folder is merely a convenience method.

Thank you for kind answering!


text:
2.8 - Addons Window is blank!
I tried uninstalling and loading factory settings. Whenever I open my Preferences -> Addons window, I get a blank screen. Help I cant use addons on this machine anymore. It happened after installing a supposedly 2.8 compatible addon.

In addition to second part of @rjg's answer:
Do not touch Blender installation directory. All user settings and addons stores in user AppData folder.
Try to rename "C:\Users@username@\AppData\Roaming\Blender Foundation\Blender\2.80" folder to "2.80 backup" and restart Blender.
Fresh folder 2.80 will be created. If there are no global problems with the system - everything should work fine

It's correct that AppData stores the preferences, but if the factory reset in the UI and
--factory-startup didn't resolve the problem, you will have to remove the add-on manually. This will be unlikely, but it's not impossible that something breaks while Blender is iterating through the add-ons (which would be a bug though). Removing the original AppData has the same effect as starting Blender with the --factory-startup flag, with the only difference that it isn't temporary. It won't remove the broken add-on though and you don't have your old preferences.

When you know exactly which files have been installed, it's save to remove them from the add-ons folder.

If you haven't installed it through the UI and simply copied it to the add-ons folder, it's actually the only way to really get rid of it.

This fixed it. Thanks. I can see everything now but yes indeed I needed to redo my bindings and shit.

@Sudo that's why I didn't recommend this approach.

@Sudo be aware that this approach did not remove the broken add-on, it only deactivated it.

There are two options that you could try.

The Factory Startup
The first would be to start Blender from command line with the --factory-startup which should prevent the broken add-on to be activated on startup.

Open the Windows Explorer Win+E
Navigate to the installation directory of Blender 2.8. You should see the blender.exe in the folder.
Type cmd in the path field and press enter. The command line prompt should open.
Type .\blender.exe --factory-startup on the command line and press enter

Blender should now start with the factory settings and you should be able to open the add-ons section of the preferences. Find the broken add-on in the list, open the detail section and click on the Remove button.

Manually Removing an Add-on
You should only use this approach if the first one didn't work, either because the add-ons are still not listed or there is no remove button for the add-on. If the former occurred, please report this on Blender's bug tracker (Help > Report a Bug). The latter will happen if you manually copied the add-on files to the add-ons directory instead of installing it through the UI.
If you know what files have been installed with the add-on you can remove them manually. Do not remove any files if you're not 100% certain that they are part of the problematic add-on. The add-on should be installed in one of the following subfolders in Blender's installation directory:

\2.80\scripts\addons
\2.80\scripts\addons_contrib

You can simply delete the broken add-on files and it should be working again.

When missing UI elements happens, then you will see most likely a error message in the console. This error message will tell you the exact trouble maker, including path of the python script. And then you can delete or fix it.
At Windows the console can be opened from the Window menu. At Linux the system console is used. The Linux version of Blender does not have this menu item.


text:
Calling bpy ops fails with context is incorrect
I have a bare bones script that has 2 lines:
import bpy

bpy.ops.mesh.rip()

I've made sure I am in EDIT mode and have edges selected in edge mode. It fails with
RuntimeError: Operator bpy.ops.mesh.rip.poll() failed, context is incorrect

But I've fulfilled all of the context rules in the docs. Anybody?

For whatever reason, I couldn't get ANY Blender bpy.ops.mesh.rip rip_move rip_edge rip_edge_move at all BUT the same thing exists in bmesh functionality called split_edges (facepalm). Following code splits all edges along any edge that is marked as "seam".
bm = bmesh.new()
bm.from_mesh(me)

seamEdges = []
for edge in bm.edges:
    if edge.seam:
        edge.select = True
        seamEdges.append(edge)

bmesh.ops.split_edges(bm,edges=seamEdges)
#apply
bpy.ops.object.mode_set(mode = 'OBJECT')
bm.to_mesh(me)
bm.free()

Cool. Recommend using bmesh over bpy.ops.mesh whenever possible. List comp is handy here edges=[e for e in bm.edges if e.seam]

Found this Older Thread that helped me. Essentially, I've ignored everything but this part: bpy.ops.mesh.rip('INVOKE_DEFAULT'), and it started working. Not sure how or why it works, since I haven't found the INVOKE_DEFAULT part in API docs, nor in blender source code for blender/source/blender/editors/mesh/editmesh_rip.c. I'm using Blender 2.90.1.

`'INVOKE_DEFAULT`` is an execution context. An operator has an invoke method. If it is called via UI, by default the operator is "invoked" in this execution context with default settings, unless set to do otherwise. See  https://blender.stackexchange.com/questions/6101/poll-failed-context-incorrect-example-bpy-ops-view3d-background-image-add/6105#6105


text:
Orbiting around axis at an angle
As you know, Earth rotates around it's axis in an angle of 23.5 degrees. How do I make a sphere in Blender rotate like this?

Set the sphere's y-axis to 23.5 and Rotation Mode to ZYX Euler. After that you can rotate the sphere around its local z-axis.
Set a keyframe with I at frame 1 add another one at e.g. frame 240 with z-rotation set to 359.

See also:

Manual Rotation

No need to use 359; if you type it in manually, you can use 360 just fine (or anything greater for that matter).

There are a few options

Use axis-angle rotation mode(a direct answer to your question).
Set the euler-rotation order so Z is applied last.
Use an empty parent, for the tilt and simply animate the child meshes Z axis.(I'd do this, it generally gives more control so the spin and the tilt independently).
You could use Copy Rotation constraint, but I don't think theres much advantage to this.

angular velocity in Blender is not constant. To make it constant, go to Graph Editor select the animation, in the graph select the start an end and press V and change it to vector. This is in a nutshell. look for a tutorial for the Graph Editor


text:
How can I make a duplicated object (Alt + D) a single object again?
I copied the properties from one object to multiple objects and then duplicated these objects with AltD, now I want to convert them to single objects to modify specific ones.

You could have just used Shift + D. This will duplicate objects and create unique copies.

select the object and hit U >> Object & Data


text:
How can I blend two textures together using Cycles?
I am trying to put dirty material over a concrete material in  cycles. Now I am trying to do this using a color ramp and a mix shader, but I don't know if this is the only way or best way to do this. How can I mix these two textures together?
My first way:

The concrete texture and the grunge texture:

If those are the actual sizes of the texture you are using, just on the side note you will want to keep in the power of 2. Example 256 X 256 pixel, 512 X 512 pixel and 1024 X 1024 pixel. You can read up more about it.

Related: http://blender.stackexchange.com/questions/33342/how-to-mix-face-textures-across-uv-edges

If you see an answer that solved your problem, please accept it. Thanks! :)

From your nodes setup, it looks like you're trying to mix the original shader with nothing. While this is technically possible it is not the cleanest way to do things.
You don't actually have to create a new shader and use the mix shader to mix two textures. There is a node called MixRGB which can mix two textures, without creating a new shader each time.
There are a few ways to mix a dirty texture onto another texture. Here are a few:

The most basic setup is just a basic mix:

If you change the mix type you can get a few different effects:
Overlay

Multiply

Darken

However, it looks like you want more control over what values are being effected (you're using a color ramp). So you can use the texture as the color ramp and as the texture itself (ignore the MixRGB on the bottom. That just makes it blue so it's easier to see):

On the other hand, if you do Mix two different shaders, you can give them different properties (rough concrete, anisotropic grunge, for example).


text:
AttributeError: ,_io.TextIOWrapper' object has no attribute 'next'
This code works perfectly fine outside of Blender, but the next() function does not appear to exist in Blender..
while line:
    if(line == "POSITION:\n"):
        POS1 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'
        POS2 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'
        POS3 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'
        POS4 = '[' + file.next().replace(' ',', ').replace('\n','') + ']'

    try:
        line = file.next()
    except StopIteration:
        break
file.close()
return

(Not all of my code, just the part that reads my file)

Please post a sample script which shows the error and can run on its own, this seems like it may be more of a bug report too.

Blender 2.6x comes with its own Python in Version 3.3.x, and in Py3k it's __next__().
You can do simpler, however:
for line in file:
    print(line)

u can try this:
:
with open("updated_test.csv",'w') as f1:
with open("Review.csv",'r+') as f:
    f.next()
    for line in f:
        f1.write(line)


text:
Create a road along large terrain
I created a terrain in blender. I have on it a base layer. The base layer comprised of two textures. These are a dirt and rock texture mixed together using another texture as a mask. On top of this texture I would like to create a road. I have another mask texture for the road. I am using tiling textures for the base layer, only the masks are non-tiling: they take up the entire UV space. The road also must be tiling somehow, I cannot create a 32k texture.

How can I have a tiling road texture follow a path so that it looks like an actual road? This is an example of a tiling road that correctly follow a path.

blend file textures are packed and set up is clear

I don't think there is a way to deform the texture like that. Your not just showing the road texture, you want to bend it to follow a section of the mask. I would make a small section of road then use an array and curve modifiers and shrinkwrap it to the terrain.

how do game engines do this?

Not game engine, 3d modelling. Not certain if you have to apply modifiers for the bge but it would probably help performance.

Create a small section of road.

Add a curve to define the path the road will follow.

Back on the road section, add an array modifier, a curve modifier and a shrikwrap modifier. You set the array to fit the length of the curve. Then it follows the curve and the shrinkwrap sticks it to the terrain surface.

Giving a final result -

The curve can then be hidden. Or you can apply the modifiers and join the road mesh to the terrain mesh so they are one. Applying separate materials to each section of mesh.

It can be done with Attribute node, using another Vector/UV coordinate to define the "road path".
Unfortunately, for complicated meshs like this terrain, it will take quite a bit of work to unwrap a specific UV set for this node. Also ,the result is not very cleaned up:

For a better UV set, you have to re-model the mesh and unwrap that part before doing so:

Considering the complexity for such work, I personally recommend to assign different materials for the road and terrain area, which can be controlled better (although not very good for fading material boders).


text:
Python API: Multiple types in single UIList, dynamic memory allocation for serialized data
These questions are about the addon that I'm creating. Please excuse the bad/messy example code, I've been following the "get it working first, then optimize" philosophy.
Issue 1 (dynamic memory allocation):
For my addon, I have defined several custom primitive datatypes (they are all classes derived from bpy.types.PropertyGroup). I want to allow users to add as many of these as they like, so the amount of storage space or data items I will need is unknown (it will be determined at runtime by how many items the user adds).
The only way I know to get blender to manage an unknown number of objects is to create a CollectionProperty (or list) of that object and to call .add() on it, so that new items are added as needed and stored to disk (serialized) by Blender.
Question: Are there better, alternative methods for doing this with the Blender Python API? In C++, I can create a single vector or array of memory addresses/pointers (those pointers pointing to different data types if desired), and then use malloc to request a new empty block of memory to store whatever I want inside, for instance...
Issue 2 (combined list output/pointers):
I want to display multiple types of data in a single unified list in Blender's interface. Every Panel has a UILayout attribute that allows you to define a custom interface layout. If you want to add a list to your panel, you have to use the template_list() function, and you need to supply it with a single CollectionProperty (which is a list of your items).
Because (as stated above) my addon stores user data in multiple lists (one per type of data), I can't directly pass template_list a single list that holds all of my data. To get around this, I have tried to construct a combined list where each item contains a reference to items from the other lists.
In the interface, users add primitive slots with +/- buttons (which adds a pointer item called VEFListItem), then fill the slot with a primitive by clicking on a primitive button directly below the list.
The problem in the code below happens in my AddPoint operator, which attempts to assign a new point primitive to one of the list slots. This doesn't work because VEFListItem has an attribute called data (which is intended to point to an item in one of the primitive lists) that is not a descendent of bpy_struct.
I have also tried making data a bpy.props.PointerProperty(), but in order to do that it seems that I need to specify beforehand what type of data it will be pointing to, and of course I don't know since that is determined at runtime by the user.
Question: Does the Blender API allow me to point to data without first specifying that data's type? Are there alternative approaches here? I know that with this approach, there is the potential problem of stale data with a combined list (which I attempted to get around by reconstructing the list every time a new primitive item is added).
Sample code:
# I will eventually be using these modules
import bpy, bmesh, math, mathutils

# Required addon info (needed to list in the addons panel in user prefs)
# Expand later with remaining entries
bl_info = { "name": "VEF Tools Alpha",
            "description": "Enables arbitrary, precise transformations on mesh elements while modeling",
            "author": "XXXX XXXXXX",
            "version": "0, 1",
            "blender": "2, 68, 0",
            "location": "Properties > Scene > VEF Tools",
            "warning": "Unstable, use at your own risk",
            "category": "Mesh" }
# empty line

# //////////////////////////////
# SECTION: Basic data structures

# Point primitive
class VEFPoint( bpy.types.PropertyGroup ):
    name = bpy.props.StringProperty() # user defined object name

    # coords for this point/vert
    x = bpy.props.FloatProperty()
    y = bpy.props.FloatProperty()
    z = bpy.props.FloatProperty()

    # This class is registered in the register function below

# Line primitive, maybe aggregate VEFPoint types here later? And check precision...
class VEFLine( bpy.types.PropertyGroup ):
    name = bpy.props.StringProperty() # user defined object name

    # Coords of line origin/first point
    x1 = bpy.props.FloatProperty()
    y1 = bpy.props.FloatProperty()
    z1 = bpy.props.FloatProperty()

    # Coords of line destination/second point
    x2 = bpy.props.FloatProperty()
    y2 = bpy.props.FloatProperty()
    z2 = bpy.props.FloatProperty()

    # This class is registered in the register function below

# Plane primitive, maybe aggregate VEFPoint or VEFLine types here later?
class VEFPlane( bpy.types.PropertyGroup ):
    name = bpy.props.StringProperty() # user defined object name

    # Coords of plane origin/first point
    x1 = bpy.props.FloatProperty()
    y1 = bpy.props.FloatProperty()
    z1 = bpy.props.FloatProperty()

    # Coords of plane second point
    x2 = bpy.props.FloatProperty()
    y2 = bpy.props.FloatProperty()
    z2 = bpy.props.FloatProperty()

    # Coords of plane third point
    x3 = bpy.props.FloatProperty()
    y3 = bpy.props.FloatProperty()
    z3 = bpy.props.FloatProperty()

    # This class is registered in the register function below

class VEFListItem( bpy.types.PropertyGroup ):
    data = None

    # # This isn't getting called. Fix.
    # def __init__( self ):
        # self.data = None

class VEFData( bpy.types.PropertyGroup ):
    vefPointList = bpy.props.CollectionProperty( type = VEFPoint )
    vefLineList = bpy.props.CollectionProperty( type = VEFLine )
    vefPlaneList = bpy.props.CollectionProperty( type = VEFPlane )
    vefGuiList = bpy.props.CollectionProperty( type = VEFListItem )
    activeListItemIndex = bpy.props.IntProperty() # stores index of active primitive in my UIList

    # def __init__(self):
        # for item in vefPointList:
            # self.vefGUIList.add( item )
        # for item in vefLineList:
            # self.vefGUIList.add( item )
        # for item in vefPlaneList:
            # self.vefGUIList.add( item )

    def syncList(self):
        for i in range( len( self.vefGuiList ) ):
            self.vefGuiList.remove( 0 )
        for item in self.vefPointList:
            tmp = self.vefGuiList.add()
            tmp.data = item
        for item in self.vefLineList:
            tmp = self.vefGuiList.add()
            tmp.data = item
        for item in self.vefPlaneList:
            tmp = self.vefGuiList.add()
            tmp.data = item
    # This class is registered in the register function below

# END SECTION: Basic data structures
# //////////////////////////////////
# SECTION: Operators

# set the currently active object to a new primitive
class AddPoint( bpy.types.Operator ):
    bl_idname = "vef.addnewpoint"
    bl_label = "Add a new point"
    bl_options = {'REGISTER', 'UNDO'}

    def execute( self, context ):
        print( "NOTHING TO SEE HERE FOLKS." )
        bpy.context.scene.update()
        durp = bpy.context.scene.vef_data.vefPointList.add()
        bpy.context.scene.update()
        print( "DURP: ", durp, "\n" )
        bpy.context.scene.vef_data.vefGuiList[bpy.context.scene.vef_data.activeListItemIndex].data = durp
        bpy.context.scene.update()
        print( "AFTER ASSIGN: ", bpy.context.scene.vef_data.vefGuiList[bpy.context.scene.vef_data.activeListItemIndex].data, "\n" )
        bpy.context.scene.update()

        return {'FINISHED'}

class AddLine( bpy.types.Operator ):
    bl_idname = "vef.addnewline"
    bl_label = "Add a new line"
    bl_options = {'REGISTER', 'UNDO'}

    def execute( self, context ):
        bpy.context.scene.vef_data.vefGuiList[bpy.context.scene.vef_data.activeListItemIndex].data = bpy.context.scene.vef_data.vefLineList.add()
        bpy.context.scene.update()

        return {'FINISHED'}

class AddPlane( bpy.types.Operator ):
    bl_idname = "vef.addnewplane"
    bl_label = "Add a new plane"
    bl_options = {'REGISTER', 'UNDO'}

    def execute( self, context ):
        bpy.context.scene.vef_data.vefGuiList[bpy.context.scene.vef_data.activeListItemIndex].data = bpy.context.scene.vef_data.vefPlaneList.add()
        bpy.context.scene.update()

        return {'FINISHED'}

# Finish later, put in different section
class AddListItem( bpy.types.Operator ):
    bl_idname = "vef.addlistitem" # Check the blender precedent here for naming
    bl_label = "Add a new item"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        item = bpy.context.scene.vef_data.vefGuiList.add()
        bpy.context.scene.update()

        # # Change the active item to the newly added item...will the new item always be last in the collection?
        # bpy.context.scene.vef_data.activeListItemIndex = len( bpy.context.scene.vef_data.vefGuiList ) - 1

        if len( bpy.context.scene.vef_data.vefGuiList ) == 1:
            bpy.context.scene.vef_data.activeListItemIndex = 0

        return {'FINISHED'}

class RemoveListItem( bpy.types.Operator ):
    bl_idname = "vef.removelistitem"
    bl_label = "Remove an item"
    bl_options = {'REGISTER', 'UNDO'}

    #UPDATE THE ACTIVE ITEM INDEX AFTER YOU remove something
    def execute(self, context):
        addonData = bpy.context.scene.vef_data
        if len( addonData.vefGuiList ) == 0 :
            print( "\nNothing to remove\n" )
        elif addonData.vefGuiList[addonData.activeListItemIndex].data == None:
            print( "Muffins are great." )
            addonData.vefGuiList.remove( addonData.activeListItemIndex )
            bpy.context.scene.update()
            if len( addonData.vefGuiList ) < 1 or addonData.activeListItemIndex == 0:
                addonData.activeListItemIndex = 0
            else:
                addonData.activeListItemIndex -= 1
        elif type( addonData.vefGuiList[addonData.activeListItemIndex].data ) == bpy.types.VEFPoint:
            for item in addonData.vefPointList:
                if item == addonData.vefGuiList[addonData.activeListItemIndex].data:
                    addonData.vefGuiList[addonData.activeListItemIndex].data = None
                    addonData.vefPointList.remove()
                    addonData.vefGuiList.remove( addonData.activeListItemIndex )
                    bpy.context.scene.update()
                    if len( addonData.vefGuiList ) < 1 or addonData.activeListItemIndex == 0:
                        addonData.activeListItemIndex = 0
                    else:
                        addonData.activeListItemIndex -= 1

        elif type( addonData.vefGuiList[addonData.activeListItemIndex].data ) == bpy.types.VEFLine:
            for item in addonData.vefLineList:
                if item == addonData.vefGuiList[addonData.activeListItemIndex].data:
                    addonData.vefGuiList[addonData.activeListItemIndex].data = None
                    addonData.vefLineList.remove()
                    addonData.vefGuiList.remove( addonData.activeListItemIndex )
                    bpy.context.scene.update()
                    if len( addonData.vefGuiList ) < 1 or addonData.activeListItemIndex == 0:
                        addonData.activeListItemIndex = 0
                    else:
                        addonData.activeListItemIndex -= 1

        elif type( addonData.vefGuiList[addonData.activeListItemIndex].data ) == bpy.types.VEFPlane:
            for item in addonData.vefPlaneList:
                if item == addonData.vefGuiList[addonData.activeListItemIndex].data:
                    addonData.vefGuiList[addonData.activeListItemIndex].data = None
                    addonData.vefPlaneList.remove()
                    addonData.vefGuiList.remove( addonData.activeListItemIndex )
                    bpy.context.scene.update()
                    if len( addonData.vefGuiList ) < 1 or addonData.activeListItemIndex == 0:
                        addonData.activeListItemIndex = 0
                    else:
                        addonData.activeListItemIndex -= 1
        else:
            print("\nRemove list item failure.\n")

        return {'FINISHED'}

# END SECTION: Operators
# //////////////////////////////////
# SECTION: Addon UI

# Finish this later
class VEFList( bpy.types.UIList ):
    # item = [(),(),(),(),(),]

    # # Enum listing the type of the selected list item
    # VEFType = bpy.props.EnumProperty( items, "Type: ", "Kind of VEF primitive type", default="", options={'ANIMATABLE'}, update=None, get=None, set=None )

    def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
        # Check which type of primitive, separate draw code for each

        if item.data == None:
            layout.label( "Uninitialized object" )
        else:
            layout.label( item.data.name )
# empty line

# Main panel containing all the functionality for the addon
class VEFGui( bpy.types.Panel ):
    bl_idname = "VEF_tools_alpha"
    bl_label = "VEF Tools Alpha"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout
        vefDataPtr = bpy.types.AnyType( bpy.context.scene.vef_data )
        addonData = bpy.context.scene.vef_data

        # We start with a row that holds the prim list and buttons for adding/subtracting prims
        dataListRow = layout.row() # Row containing list of prims and +/- buttons
        listCol = dataListRow.column() # Column holding only the list
        listCol.template_list("VEFList", "", vefDataPtr, "vefGuiList", vefDataPtr, "activeListItemIndex", type='DEFAULT' )
        dataManagementCol = dataListRow.column( align = True ) # Column holding the +/- buttons
        dataManagementCol.operator( "vef.addlistitem", icon='ZOOMIN', text="")
        dataManagementCol.operator( "vef.removelistitem", icon='ZOOMOUT', text="")

        # UI elements for the active item in the list
        itemInfoCol = layout.column()
        if len(addonData.vefGuiList) == 0:
            itemInfoCol.label( "Click the + button to add items" )
        elif addonData.vefGuiList[addonData.activeListItemIndex].data == None:
            # Put enum selector here to change the type of this item
            itemInfoCol.label( "Click to make a new item:" )
            newPrims = itemInfoCol.row()

            newPrims.operator( "vef.addnewpoint", icon = 'VERTEXSEL', text="" )
            newPrims.operator( "vef.addnewline", icon = 'EDGESEL', text="" )
            newPrims.operator( "vef.addnewplane", icon = 'FACESEL', text="" )

        elif type( addonData.vefGuiList[addonData.activeListItemIndex].data ) == bpy.types.VEFPoint:
            # Do stuff
            itemInfoRow.label( "This is a point" )
        elif type( addonData.vefGuiList[addonData.activeListItemIndex].data ) == bpy.types.VEFLine:
            # Do stuff
            itemInfoRow.label( "This is a line" )
        elif type( addonData.vefGuiList[addonData.activeListItemIndex].data ) == bpy.types.VEFPlane:
            # Do stuff
            itemInfoRow.label( "This is a plane" )

# END SECTION: Addon UI
# ////////////////////////////////////
# SECTION: Blender required addon code

def register():
    # Add in: check for existing data first. If none found, register stuff to create empties

    # Register classes to make them available for use in Blender
    # primitives + misc.
    bpy.utils.register_class( VEFPoint )
    bpy.utils.register_class( VEFLine )
    bpy.utils.register_class( VEFPlane )
    bpy.utils.register_class( VEFList )
    bpy.utils.register_class( VEFListItem )
    bpy.utils.register_class( VEFData )
    # ops
    bpy.utils.register_class( AddListItem )
    bpy.utils.register_class( RemoveListItem )
    bpy.utils.register_class( AddPoint )
    bpy.utils.register_class( AddLine )
    bpy.utils.register_class( AddPlane )
    # gui
    bpy.utils.register_class( VEFGui )

    # Extend the scene class here, so all scenes now have this data
    bpy.types.Scene.vef_data = bpy.props.PointerProperty( type = VEFData )

def unregister():
    # Check for how to remove bpy.types.Scene.vef_data, put here

    # remove class availability from blender bpy.types
    bpy.utils.unregister_class( VEFData )
    bpy.utils.unregister_class( VEFPlane )
    bpy.utils.unregister_class( VEFLine )
    bpy.utils.unregister_class( VEFPoint )

# END SECTION: Blender required addon code
# ////////////////////////////////////////

register()

Thanks ahead of time, I know this is a complicated post and I appreciate any time spent trying to figure this out.

I would suggest splitting multiple questions into individual questions so you get more specific answers.

I agree that this question is too broad. I can break it up into more narrow questions which would better fit the format.

Issue 1:
CollectionProperty is the only option if you want the properties to be serialized to your .blend by Blender and displayed in a template_list().
You could also use a variable amount of ID properties, but they are limited to primitive types with no support of subtypes, descriptions, nesting etc. You can't really use them for template_list().
You can store everything to user dir or elsewhere with your own code, if you don't need it to be stored in the .blend. Or store to an ID textblock embedded in your .blend, but with the risk of users unlinking or editing it.
Question: What do you mean by primitive / different datatypes? What do your PropertyGroup subclasses represent, and what properties do they have? And what is your addon supposed to do? It looks like you want the user to create mesh geometry within the panel, why?
Issue 2:
You shouldn't display everything in a single list if the data is very different. As you said, there could be a fake list generated from several CollectionProperty lists, which actually store the different kinds of data. Keeping the references (by index?) intact seems challanging, if you want to let the user change order of list items.
Couldn't you use a single PropertyGroup class and store all properties of all your types in here? You would leave certain properties out if the data type doesn't use it, it shouldn't cost much space (if at all). An EnumProperty would indicate what type the current collection item is. It also determines how the template_list is to be drawn.
If you can go without a template_list, it would make things much easier. You would iterate over all CollectionProperty lists and draw UI elements for each item, with almost unlimited freedom of visual appearance (but no scrollable list).

The purpose of the addon is to allow users to construct precise custom transformations that they can apply to meshes or mesh parts while modelling. The geometry primitives are there to give users ways to specify/describe geometry without actually having to build it in their scenes (they can grab from existing geometry, the 3d cursor, or type in manually), which is useful if you want to specify an imaginary axis of rotation for instance. There are other primitives too (unbuilt), these allow you to measure and perform math on geometric quantities (like point distance, angle between lines, etc.)

I am actually using your suggestion of combining the primitives into a single type and swtiching with an enum, thanks :)

Did not take the time to check the whole code and understand it in depth, but here are two hints:

We do have a generic RNA pointer type, AnyType (docs), to be used when defining a PointerProperty which might point to unknown/multiple types of data…
About coordinates, would be better to use a single FloatVectorProperty (docs) instead of three x/y/z FloatProperties, imho.

A PointerProperty accepts bpy.types.PropertyGroup or a derived class only. There is no way in bpy to store a reference to an object / ID datablock (see Is it possible to use bpy.props.PointerProperty to store a pointer to an object?). All you can do with bpy.props properties is to store a datablock name in a StringProperty (loosely linked). ID datablock pointers need to be set up in C code.


text:
How do I implement the color I have on vertex paint onto my faces?
I have painted my object with vertex-color on vertex-paint. How can I make the color visible in object-mode or edit-mode.
Meaning, how do I implement the vertex-color onto my faces so that I can see them on object-mode or edit-mode?

If you bake your vertex colors to a texture, then you would be able to see them in solid view with Textured Solid enabled.

In 3D View, hit N to bring up the right panel, then enale Textured Solid.

Now in Object Mode and Edit Mode, you will see the vertex colors.

EDIT: This appears to only work with Blender Render.


text:
Is there a list for all available python functions?
I know that a list of math functions can be found on this site
But how about functions such as

obj.data.materials.clear()
obj.data.materials.append()
len(obj.data.polygons)
.normal or
.length ?

I have always wondered whether there was an overview or list or whatnot for these functions.

These functions (or rather methods, properties and attributes) you are asking for are blender-specific, thus part of the Blender Python API (a.k.a. bpy) - just to clear it up. For standard python module features, please refer to the official python docs.
.polygons, .length etc. are properties of certain Blender type instances (objects). To find out what they do and which features are available, you need to check out the bpy API docs for a particular type (class).
There is a page in the docs about how to use the docs:
Blender/Python API Reference Usage: examples of how to use the API reference docs

Example
.polygons is a property of the type bpy.types.Mesh.
It is a type on its own, MeshPolygons, > which has an .active property and an add() method.
If you use the slice notation on .polygons, you will get elements returned of a bpy_prop_collection. The element type is MeshPolygon. A MeshPolygon has i.e. a .normal property in turn.

As you can see, the methods and properties are not found in a single place. The most valuable information is hidden in the bpy.types section of the docs. You can use the online search, or use Blender's built-in Python Console with auto-complete to figure out what is where. You can also find out the type and search for it in the API docs by adding bl_rna.identifier to an object:
>>> bpy.context.object.data.bl_rna.identifier
'Mesh'

>>> bpy.context.object.data.polygons.bl_rna.identifier
'MeshPolygons'

>>> bpy.context.object.data.polygons[0].bl_rna.identifier
'MeshPolygon'

Prepend bpy.types. and you have your type to lookup in the docs!

An API navigator can be enabled under File > User Preferences > Addons, Supported Level: Development, search for API navigator.
Change a window to the text editor and in the properties panel (CtrlT) there will now be a foldable menu called API Navigator.
Hope it helps =)

Also... if you right click any UI element and click Edit Source, the code will be displayed in this editor (unless it's from C code, you'll see a message in this case)

and of coarse if you dont understand the code you see there, codeman has pointed to the official docs, which can be cross-referenced with the actual source to obtain a more complete understanding of whats going on... i honestly never use the API nav, mostly because i get distracted from actually doing what i mean to do and end up just browsing the api.... for hours on end... which would be fine if i was trying to learn python... but i want to model, not code... lol

While you can easily get a list of operators I don't think anyone has done the same for all of blender. It would probably be too large anyway.
There is help available directly from python, you can use blender's Python console to access it. Starting with the autocomplete feature, typing in obj.data.materials. and pressing the Autocomplete button ( or CtrlSpace) will list all items available, even having entered D.objects[' autocomplete will list available object names.
The next option is listing all class attributes, which is methods and variables, so entering dir(C.active_object.data.materials) into the console gives you -
['__bool__', '__contains__', '__delattr__', '__delitem__', '__doc__', '__doc__',
'__getattribute__', '__getitem__', '__iter__', '__len__', '__module__', '__setattr__',
'__setitem__', '__slots__', 'append', 'bl_rna', 'clear', 'find', 'foreach_get',
'foreach_set', 'get', 'items', 'keys', 'pop', 'rna_type', 'values']

Names surrounded by double underline are 'builtin' implementations as defined by python - eg __len__ is the function called when you use len(C.active_object.data.materials)
Currently of limited use (the scrollback length in the console is too small) is the help function. eg help(C.active_object.data.materials) will output -
Help on bpy_prop_collection object:

class bpy_prop_collection(bpy_prop)
 |  Method resolution order:
 |      bpy_prop_collection
 |      bpy_prop
 |      object
 |
 |  Methods defined here:
 |
 |  __bool__(...)
 |      x.__bool__() <==> x != 0
 |
 |  __contains__(...)
 |      x.__contains__(y) <==> y in x
 |
 |  __delattr__(...)
 |      x.__delattr__('name') <==> del x.name
 |
<snip>
 |  ----------------------------------------------------------------------
 |  Methods inherited from bpy_prop:
 |
 |  __dir__(...)
 |
 |  __eq__(...)
 |      x.__eq__(y) <==> x==y
 |
 |  __ge__(...)
 |      x.__ge__(y) <==> x>=y
<snip>
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from bpy_prop:
 |
 |  data
 |      The data this property is using, *type* :class:`bpy.types.bpy_struct`
 |
 |  id_data
 |      The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)
 |
 |  rna_type
 |      The property type for introspection
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from bpy_prop:
 |
 |  __new__ = <built-in method __new__ of type object>
 |      T.__new__(S, ...) -> a new object with type S, a subtype of T

You can also use the Operator Sheat Sheet under Help in Blender.
When you open the Text Editor there is a list with all install operator

Thanks for your answer mkb, but that's what @sambler already said.

For every python object there are two functions that everybody should know about - dir and help they do what they say on the box so for anything you can type in the console dir(theobject) to get a list of methods and help(theobject.somemethod) to get the help information.  These are python builtin functions that should work everywhere.
Note that any members that start with one or more underscores (_) are private and should not be relied on to be available or the same in future or later versions.

I was going to write this answer before I saw it here.  I guess people wanted a more user-friendly interlace