<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks, <br>
<br>
it seems that the reason was that my shader was not yet compiled.
Even if I am still unable to build a simple shader graph this
failure is gone.<br>
<br>
haggi<br>
<br>
<br>
Am 14.11.2015 um 15:34 schrieb Mohamed Sakr:<br>
</div>
<blockquote
cite="mid:CABgy2Ls8qHE5c2t4W-X=+QKBLLtO0S9darRXzGHz5osyw=Rb1A@mail.gmail.com"
type="cite">
<div dir="ltr">not sure, try to use mesh->reserve and
mesh->set_triangle</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sat, Nov 14, 2015 at 3:43 PM, haggi
krey <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:haggi@haggi.de" target="_blank">haggi@haggi.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
following the standalone xml reader, I tried to create a
shader and<br>
assign it to my mesh.<br>
Is it correct that I add the index of the shader in the
scene->shaders<br>
array to the mesh and to the created triangle?<br>
<br>
For some reason I get an vector error in util_vector.h if I
do it this<br>
way. ShaderId is set to my self created shader which can be
found in the<br>
scene at index 4:<br>
<br>
Mesh *mesh = new Mesh();<br>
scene->meshes.push_back(mesh);<br>
Object *object = new Object();<br>
object->mesh = mesh;<br>
Transform tfm = transform_identity();<br>
object->tfm = tfm;<br>
scene->objects.push_back(object);<br>
mesh->used_shaders.push_back(shaderId);<br>
<br>
vector<float3> P;<br>
float3 p0 = { -1, -1, 0 };<br>
float3 p1 = { -1, 1, 0 };<br>
float3 p2 = { 1, 1, 0 };<br>
P.push_back(p0);<br>
P.push_back(p1);<br>
P.push_back(p2);<br>
mesh->verts = P;<br>
mesh->add_triangle(0, 1, 2, shaderId, true);<br>
<br>
Any idea what could be wrong here?<br>
<br>
haggi<br>
<br>
<br>
_______________________________________________<br>
Bf-cycles mailing list<br>
<a moz-do-not-send="true"
href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a moz-do-not-send="true"
href="http://lists.blender.org/mailman/listinfo/bf-cycles"
rel="noreferrer" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Bf-cycles mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a>
<a class="moz-txt-link-freetext" href="http://lists.blender.org/mailman/listinfo/bf-cycles">http://lists.blender.org/mailman/listinfo/bf-cycles</a>
</pre>
</blockquote>
<br>
</body>
</html>