Discussion:
[Bf-python] Accessing objects for render operation
Khalifa Lame
2014-10-21 17:38:38 UTC
Permalink
How does one retrieve the final (with all modifiers applied) vertex/face
information from objects in a blender scene? I wish feed the info into an
external renderer.

It would also be nice if it worked with curves/nurbs/meta and so on.
--
khalibloo®
Jeremy Bayley
2014-10-21 18:36:15 UTC
Permalink
Perhaps there is a more direct way but when you export a mesh there are
optional parameters and one of them is apply all modifiers.
Post by Khalifa Lame
How does one retrieve the final (with all modifiers applied) vertex/face
information from objects in a blender scene? I wish feed the info into an
external renderer.
It would also be nice if it worked with curves/nurbs/meta and so on.
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
Jeremy Bayley
2014-10-21 18:41:19 UTC
Permalink
If you are trying to get you assets without exporting it might not be
possible to do in a simple way. For example if you have modifiers on an
object and you try to link that object to another project the modifiers are
ignored. So if you don't use export you will probably have the same issue
trying to send data to an external render without doing system level coding.
Post by Khalifa Lame
How does one retrieve the final (with all modifiers applied) vertex/face
information from objects in a blender scene? I wish feed the info into an
external renderer.
It would also be nice if it worked with curves/nurbs/meta and so on.
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
Khalifa Lame
2014-10-21 18:52:52 UTC
Permalink
Exporting the mesh might not be an option in my situation. I'd like my
renderer to be able to draw on the viewport in real time. Exporting and
then reading back the data would be too slow for this.
The renderer is being designed to make use of the bgl module, so all of its
work is done within the blender application.

I can't find any good example that seems to fit my approach. cycles doesn't
depend on the python API; luxrender and co use exporters, since they don't
have any real time features.
Post by Jeremy Bayley
If you are trying to get you assets without exporting it might not be
possible to do in a simple way. For example if you have modifiers on an
object and you try to link that object to another project the modifiers are
ignored. So if you don't use export you will probably have the same issue
trying to send data to an external render without doing system level coding.
Post by Khalifa Lame
How does one retrieve the final (with all modifiers applied) vertex/face
information from objects in a blender scene? I wish feed the info into an
external renderer.
It would also be nice if it worked with curves/nurbs/meta and so on.
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
Tom Edwards
2014-10-21 19:25:50 UTC
Permalink
You want Object.to_mesh(). It returns a mesh datablock with all
modifiers etc. applied and works on all object types except empties.
Post by Khalifa Lame
Exporting the mesh might not be an option in my situation. I'd like my
renderer to be able to draw on the viewport in real time. Exporting
and then reading back the data would be too slow for this.
The renderer is being designed to make use of the bgl module, so all
of its work is done within the blender application.
I can't find any good example that seems to fit my approach. cycles
doesn't depend on the python API; luxrender and co use exporters,
since they don't have any real time features.
On Tue, Oct 21, 2014 at 7:41 PM, Jeremy Bayley
If you are trying to get you assets without exporting it might not
be possible to do in a simple way. For example if you have
modifiers on an object and you try to link that object to another
project the modifiers are ignored. So if you don't use export you
will probably have the same issue trying to send data to an
external render without doing system level coding.
On Tue, Oct 21, 2014 at 10:38 AM, Khalifa Lame
How does one retrieve the final (with all modifiers applied)
vertex/face information from objects in a blender scene? I
wish feed the info into an external renderer.
It would also be nice if it worked with curves/nurbs/meta and so on.
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
Khalifa Lame
2014-10-21 20:28:03 UTC
Permalink
Thanks.

One other thing, please. I need to access the final results of the texture
stack. For example, a texture for the model's color (the result of blending
all the textures that influence color), another for normals, another for
specular, etc.

bpy.types.Texture.evaluate() sounds like it could be useful but it doesn't
take any arguments that could specify which channel to return eg. color,
normal, alpha or spec
You want Object.to_mesh(). It returns a mesh datablock with all modifiers
etc. applied and works on all object types except empties.
Exporting the mesh might not be an option in my situation. I'd like my
renderer to be able to draw on the viewport in real time. Exporting and
then reading back the data would be too slow for this.
The renderer is being designed to make use of the bgl module, so all of
its work is done within the blender application.
I can't find any good example that seems to fit my approach. cycles
doesn't depend on the python API; luxrender and co use exporters, since
they don't have any real time features.
Post by Jeremy Bayley
If you are trying to get you assets without exporting it might not be
possible to do in a simple way. For example if you have modifiers on an
object and you try to link that object to another project the modifiers are
ignored. So if you don't use export you will probably have the same issue
trying to send data to an external render without doing system level coding.
Post by Khalifa Lame
How does one retrieve the final (with all modifiers applied)
vertex/face information from objects in a blender scene? I wish feed the
info into an external renderer.
It would also be nice if it worked with curves/nurbs/meta and so on.
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
_______________________________________________
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
Tom Edwards
2014-10-22 18:29:19 UTC
Permalink
Look into baking. There are various options including "full bake", which
should give you a texture with all lighting, shaders, etc. applied. I've
not actually tried using that system myself though.
Post by Khalifa Lame
Thanks.
One other thing, please. I need to access the final results of the
texture stack. For example, a texture for the model's color (the
result of blending all the textures that influence color), another for
normals, another for specular, etc.
bpy.types.Texture.evaluate() sounds like it could be useful but it
doesn't take any arguments that could specify which channel to return
eg. color, normal, alpha or spec
You want Object.to_mesh(). It returns a mesh datablock with all
modifiers etc. applied and works on all object types except empties.
Post by Khalifa Lame
Exporting the mesh might not be an option in my situation. I'd
like my renderer to be able to draw on the viewport in real time.
Exporting and then reading back the data would be too slow for this.
The renderer is being designed to make use of the bgl module, so
all of its work is done within the blender application.
I can't find any good example that seems to fit my approach.
cycles doesn't depend on the python API; luxrender and co use
exporters, since they don't have any real time features.
On Tue, Oct 21, 2014 at 7:41 PM, Jeremy Bayley
If you are trying to get you assets without exporting it
might not be possible to do in a simple way. For example if
you have modifiers on an object and you try to link that
object to another project the modifiers are ignored. So if
you don't use export you will probably have the same issue
trying to send data to an external render without doing
system level coding.
On Tue, Oct 21, 2014 at 10:38 AM, Khalifa Lame
How does one retrieve the final (with all modifiers
applied) vertex/face information from objects in a
blender scene? I wish feed the info into an external
renderer.
It would also be nice if it worked with curves/nurbs/meta
and so on.
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
Khalifa Lame
2014-10-22 18:49:06 UTC
Permalink
I was afraid you might suggest baking. It's slow and has a lot of land
mines.
I was initially hoping blender would have the computed textures
conveniently stored somewhere.
Thanks a lot for your time.
Post by Tom Edwards
Look into baking. There are various options including "full bake", which
should give you a texture with all lighting, shaders, etc. applied. I've
not actually tried using that system myself though.
Thanks.
One other thing, please. I need to access the final results of the
texture stack. For example, a texture for the model's color (the result of
blending all the textures that influence color), another for normals,
another for specular, etc.
bpy.types.Texture.evaluate() sounds like it could be useful but it
doesn't take any arguments that could specify which channel to return eg.
color, normal, alpha or spec
Post by Tom Edwards
You want Object.to_mesh(). It returns a mesh datablock with all
modifiers etc. applied and works on all object types except empties.
Exporting the mesh might not be an option in my situation. I'd like my
renderer to be able to draw on the viewport in real time. Exporting and
then reading back the data would be too slow for this.
The renderer is being designed to make use of the bgl module, so all of
its work is done within the blender application.
I can't find any good example that seems to fit my approach. cycles
doesn't depend on the python API; luxrender and co use exporters, since
they don't have any real time features.
Post by Jeremy Bayley
If you are trying to get you assets without exporting it might not be
possible to do in a simple way. For example if you have modifiers on an
object and you try to link that object to another project the modifiers are
ignored. So if you don't use export you will probably have the same issue
trying to send data to an external render without doing system level coding.
Post by Khalifa Lame
How does one retrieve the final (with all modifiers applied)
vertex/face information from objects in a blender scene? I wish feed the
info into an external renderer.
It would also be nice if it worked with curves/nurbs/meta and so on.
--
khalibloo®
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
_______________________________________________
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
_______________________________________________
_______________________________________________
Bf-python mailing list
http://lists.blender.org/mailman/listinfo/bf-python
--
khalibloo®
Loading...