great, thanks for the help. Is there any way to give the object a name as
you're loading it? This will be handled by a script, so I won't be able to
pick the right name interactively.
from cgkit.all import *
> model = worldObject("model_name")
> model.geom.intersectRay((1,2,3), (0,1,0))
> You can find out the name of your geometry by calling listWorld() after
> loading the model which will dump the names of the objects in the
> current scene.
> If you do all that from within a script that is invoked using the viewer
> tool you could omit the first two lines (i.e. the import and load()) and
> pass the file name on the command line.
> The load(), worldObject() and listWorld() functions are mentioned here:
> - Matthias -
Rodrigo Culagovski wrote:
> great, thanks for the help. Is there any way to give the object a name
> as you're loading it? This will be handled by a script, so I won't be
> able to pick the right name interactively.
Well, the 3ds file might contain more than just one object. Giving the
objects new names while they are loaded is currently not possible, you
could only group them under a common parent (passing the keyword
argument "parent" to the load() function).
But intersectRay() has to be called directly on the geom, so you can't
use the parent for that.
But instead of obtaining the objects by name, you can also iterate over
the scene (using scene.walkWorld(), for example) and check which object
is a TriMesh and then shoot your rays on those objects.
- Matthias -