Page 1 of 1

Some problems...

Posted: Thu Feb 01, 2007 5:50 am
by Iqwar
Hi all, firstly, sorry for my bad english...:oops:

1. Is there any way to export particles? /convert to mesh or something...?
2. I tried basic sss scene within Indigo testscenes directory and they couldn“t work for me...Can anyone
upload any functional basic sss xml scene for indigo 0.73 with glass sphere?
/or whatever else :roll:
3. Thanx all indigo staff for great work!

Posted: Thu Feb 01, 2007 10:38 am
by dougal2
particles can be converted to a mesh with a CVS build of blender, and this script:

Code: Select all

# Converts particles into a mesh with edges for strands
from Blender import Scene, Mathutils, Effect, Mesh, Object
scn= Scene.GetCurrent()
ob= scn.getActiveObject()
me= Mesh.New()
     
effects= Effect.Get()
for eff in effects:
    for p in eff.getParticlesLoc():
        # p is either a vector or a list of vectors. me.verts.extend() will deal with either
        print p
        me.verts.extend(p)
     
        if type(p)==list: # Are we a strand or a pair, then add edges.
            if len(p)>1:
                edges= [(i, i+1) for i in range(len(me.verts)-len(p), len(me.verts)-1)]
                me.edges.extend( edges )
     
print len(me.verts)
ob= Object.New('Mesh')
ob.link(me)
scn.link(ob)
i didn't write this script. also forget where i found it.

Posted: Sun Feb 04, 2007 8:56 am
by Kram1032
Is this a phytonscript?
If so, shouldn't be the first line "!bpy! or something like this?

Posted: Sun Feb 04, 2007 9:07 am
by CTZn
i didn't write this script. also forget where i found it.

You may have found it here:

http://www.zoo-logique.org/3D.Blender/s ... class.html

8)

Posted: Sun Feb 04, 2007 10:00 am
by Kram1032
These are commands and variables and something like that, but I mean the first line...

#!BPY

That's copied from one of the standart blenderpythonscripts...
You'll find it in any bpy. This is the line to let blender know, that it's a script for blender.

"""
Name: '3D Studio (.3ds)...'
Blender: 241
Group: 'Import'
Tooltip: 'Import from 3DS file format (.3ds)'
"""

This part is missing too....
It tells blender, how it should be named, which is the first version, it's used for, in which category this will appear and what's the tool tip text, when positioning your cursor above it...

I just wonder, that it works... I'll test it...

Posted: Sun Feb 04, 2007 5:16 pm
by zsouthboy
an easy way to get particles into indigo:
use dupliverts, in blender. just use a small cube as the original mesh.

Then, when the particles look like you'd like, ctrl shift A to turn them into (linked) meshes.

Posted: Sun Feb 04, 2007 9:55 pm
by Kram1032
Nice trick, but what's with Hairs ;)

Posted: Mon Feb 05, 2007 9:33 am
by dougal2
there's more to running scripts in blender than merely selecting one form the GUI menu.

switch to the text editor window, load that script as a text file (or copy+paste i in) and either press ALT+P to execute it, or right click the window and choose the execute option.

the !#BPY or whatever header is not neccesary.
the other header lines simply tell blender where to file it under the menu, but as i said, you don't need to even have it in the menu to be able to run it.

Image

Posted: Thu Feb 08, 2007 2:29 am
by kepler
Hello, I have a problem with that script! I've tried to run it but it doesn't work. Here's the error from the console: "TypeError: expected float argument". The error is referred to this line of the script: "for p in eff.getParticlesLoc()".

Can someone help me? There's another way to convert particles into mesh? :roll:

Posted: Thu Feb 08, 2007 3:29 am
by dougal2
kepler wrote:Hello, I have a problem with that script! I've tried to run it but it doesn't work. Here's the error from the console: "TypeError: expected float argument". The error is referred to this line of the script: "for p in eff.getParticlesLoc()".

Can someone help me? There's another way to convert particles into mesh? :roll:
apologies if my screenshot is misleading, but as i said earlier in the thread - this script will NOT work with blender 2.42, you need a NEWER build.

either get 2.43RC3 or look here for experimental builds: http://www.graphicall.org/builds/index.php

Posted: Thu Feb 08, 2007 3:36 am
by Kram1032
why using graphicall? Is the Blender 2.43RC2 not new enough?

Build 2.43RC3 out now^^

Posted: Thu Feb 08, 2007 3:41 am
by dougal2
Kram1032 wrote:why using graphicall? Is the Blender 2.43RC2 not new enough?
yeah that should work, here's the link i was looking for
http://blender3d.org/cms/Changes_since_2_42.771.0.html