<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/9709" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2014-01-30T15:13:15+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/9709</id>

		<entry>
		<author><name><![CDATA[rob_marc2003]]></name></author>
		<updated>2014-01-30T15:13:15+00:00</updated>

		<published>2014-01-30T15:13:15+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32746#p32746</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32746#p32746"/>
		<title type="html"><![CDATA[Re: Importing a .bullet file from Blender]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32746#p32746"><![CDATA[
short Update:<br>I've managed to access the hinges and it's properties: <div class="codebox"><p>Code: </p><pre><code>for(int i=0; i &lt; dynamicsWorld-&gt;getNumConstraints(); i++){btTypedConstraint*constraint=dynamicsWorld-&gt;getConstraint(i);printf("  constraint type = %i\n", constraint-&gt;getConstraintType());printf("  collision shape type = %i\n", constraint-&gt;getRigidBodyA().getCollisionShape()-&gt;getShapeType());printf("  get partA axisVector (part of quaternion) = (%4.3f,%4.3f,%4.3f)\n",constraint-&gt;getRigidBodyA().getCenterOfMassTransform().getRotation().getX(),constraint-&gt;getRigidBodyA().getCenterOfMassTransform().getRotation().getY(),constraint-&gt;getRigidBodyA().getCenterOfMassTransform().getRotation().getZ());printf("  get partA CenterOfGeometry = (%4.3f,%4.3f,%4.3f)\n",constraint-&gt;getRigidBodyA().getCenterOfMassPosition().getX(),constraint-&gt;getRigidBodyA().getCenterOfMassPosition().getY(),constraint-&gt;getRigidBodyA().getCenterOfMassPosition().getZ());}</code></pre></div>Although I still can't find a way how to access a constraint's related rigidbodies names (i.e. hinge-&gt;rigidBodyA-&gt;name and hinge-&gt;rigidBodyB-&gt;name).<br><br>Any thoughts on this?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10541">rob_marc2003</a> — Thu Jan 30, 2014 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rob_marc2003]]></name></author>
		<updated>2014-01-28T18:13:18+00:00</updated>

		<published>2014-01-28T18:13:18+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32724#p32724</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32724#p32724"/>
		<title type="html"><![CDATA[Re: Importing a .bullet file from Blender]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32724#p32724"><![CDATA[
I've managed to access rigid body properties via the following lines:<br><div class="codebox"><p>Code: </p><pre><code>for(int i=0; i &lt; fileLoader-&gt;getNumRigidBodies(); i++){btCollisionObject* obj = fileLoader-&gt;getRigidBodyByIndex(i);btRigidBody* body = btRigidBody::upcast(obj);// propertiesprintf("  object name = %s\n", fileLoader-&gt;getNameForPointer(body));// The Blender object name    printf("  get position = (%4.3f,%4.3f,%4.3f)\n", body-&gt;getCenterOfMassPosition().getX(),body-&gt;getCenterOfMassPosition().getY(), body-&gt;getCenterOfMassPosition().getZ());// Blender CoMprintf("  get local scaling = (%4.3f,%4.3f,%4.3f)\n", body-&gt;getCollisionShape()-&gt;getLocalScaling().getX(),body-&gt;getCollisionShape()-&gt;getLocalScaling().getY(),body-&gt;getCollisionShape()-&gt;getLocalScaling().getZ());// Blender Dimensionsif (body-&gt;getInvMass() == 0)printf("  static object\n");else{printf("  mass = %4.3f\n", 1/body-&gt;getInvMass());// Blender Massprintf("  get gravity (z!) = %4.3f\n", body-&gt;getGravity().getZ());// Blender Gravity}printf("\n");}</code></pre></div>I still don't know how to access the contstraints (i.e. hinges) after importing the .bullet file. Any thoughts on that?<br><br>Cheers,<br>Rob<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10541">rob_marc2003</a> — Tue Jan 28, 2014 6:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2014-01-28T03:29:58+00:00</updated>

		<published>2014-01-28T03:29:58+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32721#p32721</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32721#p32721"/>
		<title type="html"><![CDATA[Re: Importing a .bullet file from Blender]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32721#p32721"><![CDATA[
I would guess after import you can access the rigid bodies, joints, and shapes from the world interface and iterate all the information you need.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Tue Jan 28, 2014 3:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rob_marc2003]]></name></author>
		<updated>2014-01-27T17:00:07+00:00</updated>

		<published>2014-01-27T17:00:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32717#p32717</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32717#p32717"/>
		<title type="html"><![CDATA[Importing a .bullet file from Blender]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=32717#p32717"><![CDATA[
Hi there,<br><br>After exporting a scene in Blender into .bullet file format according to <a href="http://www.youtube.com/watch?v=fv-Oq5oe8Nw" class="postlink">this</a>, I load the respective .bullet file in a simple application following the serialization <a href="http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization" class="postlink">wiki</a>:<br><div class="codebox"><p>Code: </p><pre><code>btBulletWorldImporter* fileLoader = new btBulletWorldImporter(dynamicsWorld);fileLoader-&gt;loadFile("h:\\testFile.bullet");</code></pre></div>Question: how can I access rigid body parameters (like mass, dimensions, inertia etc.) in the Bullet world inside my program?<br><br>Thanks,<br>R<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10541">rob_marc2003</a> — Mon Jan 27, 2014 5:00 pm</p><hr />
]]></content>
	</entry>
	</feed>
