Google

Softbody support - New bindings

A discussion on Python-Ogre, the library which allows you to drive OGRE directly from Python

Moderators: OGRE Team, Python-Ogre Moderators

Softbody support - New bindings

Postby thios » Sun Oct 02, 2011 2:45 pm

I believe that the easiest way to add softbody support to python-ogre is to get bindings working for btogre together with code from here. Has anyone tried this before? Or could someone provide maybe a comprehensible pyplusplus howto about generating new bindings?
thios
Gnoblar
 
Posts: 19
Kudos: 0
Joined: 05 Feb 2011

Re: Softbody support - New bindings

Postby dermont » Tue Oct 04, 2011 5:49 am

thios wrote:I believe that the easiest way to add softbody support to python-ogre is to get bindings working for btogre together with code from here. Has anyone tried this before? Or could someone provide maybe a comprehensible pyplusplus howto about generating new bindings?


Interesting link, unfortunately the btOgre implementation will not help since the softbody demo appears to use softbody code directly from the bullet API; for some reason softbody support isn't included in the current bullet module.

Are you building python-ogre from source?

I'll take a look at updating the bullet module ( it will be bullet 2.59) to include softbody support and wrapping the version of btOgre from the link you provided.
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby dermont » Tue Oct 04, 2011 8:54 am

1) OK updated bullet (2.79) for Linux to include softbody support.

a) Missing classes
- Problem with btTrixIndex (btHashMap /btAlignedObjectArray) and no default ctor/ copty ctor(?):
btSoftBodyConcaveCollisionAlgorithm
btSoftBodyTriangleCallback

- symbol not found loading module on Linux
RayFromToCaster

2) Added btogre module based on code from your link:

a) copy btOgreSoftbodyDemo/demo/data to python-ogre/demos/btogre
b) run demo btogre/test01.py (no input handler - so close as normal linux window)

3) Updated environment.py / PythonOgreConfig_*.py; haven't tested the right version of bullet is downloaded etc., so if there is a problem you may have to modify these files.

Edit:
Let me know how it goes so I can upload a patch for the bullet part to the tracker.

For this message the author dermont has received kudos
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby thios » Tue Oct 04, 2011 12:04 pm

This is fantastic. The level of support in this forum is the highest I've ever actually seen. Thanks very much! I'll try it and let you know how it goes.

EDIT: I made a fresh build of everything just to keep things neat. I followed linux build v.4 from the wiki and used a gccxml checkout from 01May2011. I tested bullet versions 2.77, 2.78 and 2.79-rev2440.

On ubuntu 11.04 64-bit, compilation of the bullet wrappers fails with:

Code: Select all
10-04 22:14 PythonOgre.BuildModule DEBUG
scons: warning: BuildDir() and the build_dir keyword have been deprecated;
        use VariantDir() and the variant_dir keyword instead.
File "/home/.../development/python-ogre/SConstruct", line 228, in <module>
/usr/bin/ld: /home/.../development/root/usr/lib/libBulletCollision.a(btAxisSweep3.o): relocation R_X86$
/home/.../development/root/usr/lib/libBulletCollision.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
scons: *** [build_dir_2.7/bullet_2.79-rev2440/bullet.so] Error 1


I'm able to compile the wrappers successfully if I build bullet with -fPIC, by manually adding the following to the root bullet CMakeLists.txt:

Code: Select all
SET(CMAKE_C_FLAGS "-fPIC")
    SET(CMAKE_CXX_FLAGS "-fPIC")


The bullet wrapper demos work as expected.

The BtOgre wrapper builds fine but then I get an undefined symbol when I try to import it:

Code: Select all
Traceback (most recent call last):
        File "test01.py", line 14, in <module>
        import ogre.physics.btogre as btogre
        File "/home/poulos/development/root/usr/lib/python2.7/site-packages/ogre/physics/btogre/__init__.py", line 1, in <module>
        from btogre import *
        ImportError: /home/poulos/development/root/usr/lib/python2.7/site-packages/ogre/physics/btogre/btogre.so: undefined symbol: _ZN6btDbvtC1Ev


I tried your suggestions in this thread but with no success yet.

I'll investigate this further (although I suspect you'll beat me to it :)).
thios
Gnoblar
 
Posts: 19
Kudos: 0
Joined: 05 Feb 2011

Re: Softbody support - New bindings

Postby dermont » Wed Oct 05, 2011 10:08 am

Not sure how much help I can be here, I've always build the python-ogre module using the bullet shared libraries.

I had another stab at building with the bullet static libs and the following changes to environment.py works for me, it should be a simple case of re-linking the modules when you recompile the module, so you can test quickly.

bullet:
Code: Select all
        libs=[boost.lib]
        LINKFLAGS ='-L<your_path_to_lib>  -Wl,-Bstatic -Wl,--whole-archive  -lBulletWorldImporter -lBulletSoftBody   -lBulletDynamics  -lBulletCollision -lBulletMultiThreaded -lConvexDecomposition  -lGIMPACTUtils -Wl,--no-whole-archive -lLinearMath   -lBulletFileLoader      -Wl,-Bdynamic'


btogre:
Code: Select all
    libs = [boost.lib, 'OgreMain']
    LINKFLAGS ='-L<your_path_to_lib>  -Wl,-Bstatic -Wl,--whole-archive  -lBulletSoftBody   -lBulletDynamics  -lBulletCollision -lBulletMultiThreaded -lConvexDecomposition  -lGIMPACTUtils -Wl,--no-whole-archive -lLinearMath    -Wl,-Bdynamic'


Other than that you could maybe consider building against the bullet shared libs.
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby thios » Thu Oct 06, 2011 12:02 am

Either suggestion works... Thanks again!

This time however the demo fails on:

Code: Select all
meshutils.meshBuffersToArrays(myMesh, MyMeshData.vertices, ctypes.addressof(indices))


The app gets this far:

Code: Select all
...@ADYTON:~/development/python-ogre/demos/btogre$ python test01.py
Creating resource group General
Creating resource group Internal
Creating resource group Autodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Skeleton
MovableObjectFactory for type 'ParticleSystem' registered.
OverlayElementFactory for type Panel registered.
OverlayElementFactory for type BorderPanel registered.
OverlayElementFactory for type TextArea registered.
Registering ResourceManager for type Font
ArchiveFactory for archive type FileSystem registered.
ArchiveFactory for archive type Zip registered.
DDS codec registering
FreeImage version: 3.13.1
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
Registering ResourceManager for type HighLevelGpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
Loading library /home/.../development/root/usr/lib/OGRE/RenderSystem_GL
Installing plugin: GL RenderSystem
OpenGL Rendering Subsystem created.
Plugin successfully installed
Loading library /home/.../development/root/usr/lib/OGRE/Plugin_ParticleFX
Installing plugin: ParticleFX
Particle Emitter Type 'Point' registered
Particle Emitter Type 'Box' registered
Particle Emitter Type 'Ellipsoid' registered
Particle Emitter Type 'Cylinder' registered
Particle Emitter Type 'Ring' registered
Particle Emitter Type 'HollowEllipsoid' registered
Particle Affector Type 'LinearForce' registered
Particle Affector Type 'ColourFader' registered
Particle Affector Type 'ColourFader2' registered
Particle Affector Type 'ColourImage' registered
Particle Affector Type 'ColourInterpolator' registered
Particle Affector Type 'Scaler' registered
Particle Affector Type 'Rotator' registered
Particle Affector Type 'DirectionRandomiser' registered
Particle Affector Type 'DeflectorPlane' registered
Plugin successfully installed
Loading library /home/.../development/root/usr/lib/OGRE/Plugin_BSPSceneManager
Installing plugin: BSP Scene Manager
Plugin successfully installed
Loading library /home/.../development/root/usr/lib/OGRE/Plugin_OctreeSceneManager
Installing plugin: Octree & Terrain Scene Manager
Plugin successfully installed
Loading library /home/.../development/root/usr/lib/OGRE/Plugin_CgProgramManager
Installing plugin: Cg Program Manager
Plugin successfully installed
*-*-* OGRE Initialising
*-*-* Version 1.7.2 (Cthugha)
Creating resource group Bootstrap
Added resource location './data/OgreCore.zip' of type 'Zip' to resource group 'Bootstrap'
Added resource location './data' of type 'FileSystem' to resource group 'General'
Added resource location './data/Meshes' of type 'FileSystem' to resource group 'General'
Added resource location './data/Textures' of type 'FileSystem' to resource group 'General'
Added resource location '../ogreode/media' of type 'FileSystem' to resource group 'General'
Added resource location '../ogreode/media/materials' of type 'FileSystem' to resource group 'General'
Added resource location '../ogreode/media/materials/scripts' of type 'FileSystem' to resource group 'General'
Added resource location '../ogreode/media/materials/textures' of type 'FileSystem' to resource group 'General'
Added resource location '../ogreode/media/models' of type 'FileSystem' to resource group 'General'
CPU Identifier & Features
-------------------------
 *   CPU ID: GenuineIntel: Intel(R) Core(TM) i3 CPU         540  @ 3.07GHz
 *      SSE: yes
 *     SSE2: yes
 *     SSE3: yes
 *      MMX: yes
 *   MMXEXT: yes
 *    3DNOW: no
 * 3DNOWEXT: no
 *     CMOV: yes
 *      TSC: yes
 *      FPU: yes
 *      PRO: yes
 *       HT: no
-------------------------
******************************
*** Starting GLX Subsystem ***
******************************
GLRenderSystem::_createRenderWindow "OGRE Render Window", 800x600 windowed  miscParams: FSAA=0 displayFrequency=60 MHz gamma=No vsync=No
GLXWindow::create used FBConfigID = 39
GL_VERSION = 4.1.10665 Compatibility Profile Context
GL_VENDOR = ATI Technologies Inc.
GL_RENDERER = AMD Radeon HD 6900 Series
GL_EXTENSIONS = GL_AMDX_debug_output GL_AMDX_vertex_shader_tessellator GL_AMD_blend_minmax_factor GL_AMD_conservative_depth GL_AMD_debug_output GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_name_gen_delete GL_AMD_performance_monitor GL_AMD_sample_positions GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_stencil_export GL_AMD_shader_trace GL_AMD_texture_cube_map_array GL_AMD_texture_texture4 GL_AMD_transform_feedback3_lines_triangles GL_AMD_vertex_shader_tessellator GL_ARB_ES2_compatibility GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_stencil_export GL_ARB_shader_subroutine GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_snorm GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_meminfo GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_buffer GL_EXT_copy_texture GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_histogram GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_bptc GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_explicit_multisample GL_NV_float_buffer GL_NV_half_float GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_barrier GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_swap_control
Supported GLX extensions: GLX_ARB_create_context GLX_ARB_create_context_profile GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_import_context GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_swap_control GLX_NV_swap_group GLX_OML_swap_method GLX_SGI_make_current_read GLX_SGI_swap_control GLX_SGI_video_sync GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGIX_swap_barrier GLX_SGIX_swap_group GLX_SGIX_visual_select_group GLX_EXT_texture_from_pixmap
***************************
*** GL Renderer Started ***
***************************
Registering ResourceManager for type GpuProgram
GLSL support detected
GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
FBO PF_UNKNOWN depth/stencil support: D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_L8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_L16 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_A4L4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_BYTE_LA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_R5G6B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_B5G6R5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_A4R4G4B4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_A1R5G5B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_A8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_B8G8R8A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_A2R10G10B10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_A2B10G10R10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_X8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_X8B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_SHORT_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_R3G3B2 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT16_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT32_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_SHORT_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT16_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_FLOAT32_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
FBO PF_SHORT_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
[GL] : Valid FBO targets PF_UNKNOWN PF_L8 PF_L16 PF_A8 PF_A4L4 PF_BYTE_LA PF_R5G6B5 PF_B5G6R5 PF_A4R4G4B4 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_FLOAT16_R PF_FLOAT32_R PF_SHORT_GR PF_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB
RenderSystem capabilities
-------------------------
RenderSystem Name: OpenGL Rendering Subsystem
GPU Vendor: ati
Device Name: AMD Radeon HD 6900 Series
Driver Version: 4.1.10665.0
 * Fixed function pipeline: yes
 * Hardware generation of mipmaps: no
 * Texture blending: yes
 * Anisotropic texture filtering: yes
 * Dot product texture operation: yes
 * Cube mapping: yes
 * Hardware stencil buffer: yes
   - Stencil depth: 8
   - Two sided stencil support: yes
   - Wrap stencil values: yes
 * Hardware vertex / index buffers: yes
 * Vertex programs: yes
 * Number of floating-point constants for vertex programs: 256
 * Number of integer constants for vertex programs: 0
 * Number of boolean constants for vertex programs: 0
 * Fragment programs: yes
 * Number of floating-point constants for fragment programs: 256
 * Number of integer constants for fragment programs: 0
 * Number of boolean constants for fragment programs: 0
 * Geometry programs: yes
 * Number of floating-point constants for geometry programs: 256
 * Number of integer constants for geometry programs: 0
 * Number of boolean constants for geometry programs: 0
 * Supported Shader Profiles: arbfp1 arbvp1 glsl gp4gp gpu_gp nvgp4 ps_1_1 ps_1_2 ps_1_3 ps_1_4
 * Texture Compression: yes
   - DXT: yes
   - VTC: no
   - PVRTC: no
 * Scissor Rectangle: yes
 * Hardware Occlusion Query: yes
 * User clip planes: yes
 * VET_UBYTE4 vertex element type: yes
 * Infinite far plane projection: yes
 * Hardware render-to-texture: yes
 * Floating point textures: yes
 * Non-power-of-two textures: yes
 * Volume textures: yes
 * Multiple Render Targets: 8
   - With different bit depths: yes
 * Point Sprites: yes
 * Extended point parameters: yes
 * Max Point Size: 8192
 * Vertex texture fetch: yes
 * Number of world matrices: 0
 * Number of texture units: 16
 * Stencil buffer depth: 8
 * Number of vertex blend matrices: 0
   - Max vertex textures: 16
   - Vertex textures shared: yes
 * Render to Vertex Buffer : no
 * GL 1.5 without VBO workaround: no
 * Frame Buffer objects: yes
 * Frame Buffer objects (ARB extension): no
 * Frame Buffer objects (ATI extension): no
 * PBuffer support: yes
 * GL 1.5 without HW-occlusion workaround: no
Registering ResourceManager for type Texture
DefaultWorkQueue('Root') initialising on thread 0x2934ac0.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x2f698c0 starting.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x2f6a2d0 starting.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x7f76cc0008b0 starting.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x7f76cc000b70 starting.
Particle Renderer Type 'billboard' registered
SceneManagerFactory for type 'BspSceneManager' registered.
Registering ResourceManager for type BspLevel
SceneManagerFactory for type 'OctreeSceneManager' registered.
SceneManagerFactory for type 'TerrainSceneManager' registered.
Parsing scripts for resource group Autodetect
Finished parsing scripts for resource group Autodetect
Parsing scripts for resource group Bootstrap
Parsing script OgreCore.material
Parsing script OgreProfiler.material
Parsing script Ogre.fontdef
Parsing script OgreDebugPanel.overlay
Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
Parsing script OgreLoadingPanel.overlay
Finished parsing scripts for resource group Bootstrap
Parsing scripts for resource group General
Parsing script Objects.material
Parsing script TestLevel.material
Parsing script Tuch.material
Parsing script racingcircuit.material
Parsing script tail_rotor.material
Parsing script zombie.material
Compiler error: reference to a non existing object in zombie.material(9)
Compiler error: reference to a non existing object in zombie.material(21)
Parsing script target.material
Parsing script kk3d.material
Parsing script jeep_body.material
Parsing script gun.material
Parsing script main_rotor.material
Parsing script door.material
Parsing script capsule.material
Parsing script landscape.material
Parsing script ball.material
Parsing script scooby_wheel.material
Parsing script apache_body.material
Parsing script autoterraintexture.material
Compiler error: number expected in autoterraintexture.material(43): incorrect float constant declaration
Parsing script scooby_body.material
Parsing script plane.material
Parsing script jeep_wheell.material
Parsing script crate.material
Parsing script jeep_wheelr.material
Parsing script ogreodedemos.particle
Parsing script myExplosion.particle
Parsing script ogreodedemos.overlay
Texture: target.png: Loading 1 faces(PF_A8R8G8B8,45x45x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,45x45x1.
Finished parsing scripts for resource group General
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
Creating resource group BtOgre
Mesh: Loading TestLevel_b0.mesh.
WARNING: TestLevel_b0.mesh is an older format ([MeshSerializer_v1.40]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: Soil.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
Mesh: Loading Tuch.mesh.
WARNING: Tuch.mesh is an older format ([MeshSerializer_v1.40]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
Texture: ist2_225083-texture-towel.jpg: Loading 1 faces(PF_R8G8B8,380x285x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,380x285x1.


...and then crashes with either of the following:

Code: Select all
Creating softbody 0
dupVerticesCount 36
newVertexCount 40
python: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted


... or:

Code: Select all
*** glibc detected *** python: malloc(): memory corruption: 0x0000000003fa52e0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x79d7a)[0x7fa659095d7a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x6e)[0x7fa65909831e]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znwm+0x1d)[0x7fa652907e0d]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znam+0x9)[0x7fa652907f29]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(+0x2f016)[0x7fa65262e016]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(+0x2f9d8)[0x7fa65262e9d8]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/physics/btogre/_btogre_.so(_ZN5boost6python7objects12value_holderI22BtOgreSoftBody_wrapperE5holdsENS0_9type_infoEb+0xa1)[0x7fa64a7ffaa1]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZN5boost6python7objects18find_instance_implEP7_objectNS0_9type_infoEb+0x71)[0x7fa652625bc1]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZN5boost6python9converter22get_lvalue_from_pythonEP7_objectRKNS1_12registrationE+0x23)[0x7fa652620cf3]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/physics/btogre/_btogre_.so(_ZN5boost6python9converter25reference_arg_from_pythonIRN6BtOgre14BtOgreSoftBodyEEC2EP7_object+0x16)[0x7fa64a7ffef6]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/physics/btogre/_btogre_.so(_ZN5boost6python6detail12caller_arityILj6EE4implIPFNS0_3api6objectERN6BtOgre14BtOgreSoftBodyEPN4Ogre6EntityEjPKNSA_7Vector3EjjENS0_21default_call_policiesENS_3mpl7vector7IS6_S9_SC_jSF_jjEEEclEP7_objectSO_+0x47)[0x7fa64a8006b7]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python7objects8function4callEP7_objectS4_+0x2be)[0x7fa65262962e]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(+0x2a888)[0x7fa652629888]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x43)[0x7fa652632d73]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre22UnimplementedExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa6573a8c23]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre25RuntimeAssertionExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa65728c333]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre21RenderingAPIExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa657288053]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre21ItemIdentityExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa657130cf3]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre21InvalidStateExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa65712ca13]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre26InvalidParametersExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa657128733]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre22InternalErrorExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa657124453]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre11IOExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa657120173]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre21FileNotFoundExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa6570ed0b3]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZNK5boost6python6detail17exception_handlerclERKNS_9function0IvEE+0x23)[0x7fa652632d53]
/home/.../development/root/usr/lib/python2.7/site-packages/ogre/renderer/OGRE/_ogre_.so(_ZN5boost6detail8function21function_obj_invoker2INS_3_bi6bind_tIbNS_6python6detail19translate_exceptionIN4Ogre9ExceptionEPFvRKS9_EEENS3_5list3INS_3argILi1EEENSG_ILi2EEENS3_5valueISD_EEEEEEbRKNS6_17exception_handlerERKNS_9function0IvEEE6invokeERNS1_15function_bufferESP_ST_+0x13)[0x7fa6570e7b03]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(_ZN5boost6python21handle_exception_implENS_9function0IvEE+0x29)[0x7fa652632b19]
/home/.../development/root/usr/lib/libboost_python.so.1.42.0(+0x2bd84)[0x7fa65262ad84]
python(PyObject_Call+0x44)[0x45d864]
python(PyEval_EvalFrameEx+0x9be)[0x496c4e]
python(PyEval_EvalFrameEx+0xb2f)[0x496dbf]
python(PyEval_EvalCodeEx+0x145)[0x49d325]
python[0x4c4526]
python(PyObject_Call+0x44)[0x45d864]
python[0x45f43f]
python(PyObject_Call+0x44)[0x45d864]
python[0x48ae3f]
python[0x48928d]
python(PyObject_Call+0x44)[0x45d864]
python(PyEval_EvalFrameEx+0x9be)[0x496c4e]
python(PyEval_EvalFrameEx+0xb2f)[0x496dbf]
python(PyEval_EvalCodeEx+0x145)[0x49d325]
python(PyEval_EvalCode+0x32)[0x4ecb02]
python[0x4fdc74]
python(PyRun_StringFlags+0x65)[0x4fdeb5]
python(PyEval_EvalFrameEx+0x566c)[0x49b8fc]
python(PyEval_EvalCodeEx+0x145)[0x49d325]
python(PyEval_EvalFrameEx+0x802)[0x496a92]
python(PyEval_EvalCodeEx+0x145)[0x49d325]
python(PyEval_EvalFrameEx+0x802)[0x496a92]
python(PyEval_EvalCodeEx+0x145)[0x49d325]
python(PyEval_EvalCode+0x32)[0x4ecb02]
python[0x4fdc74]
python(PyRun_InteractiveOneFlags+0x1e2)[0x42cd9e]
python(PyRun_InteractiveLoopFlags+0xc0)[0x42cebd]
python(PyRun_AnyFileExFlags+0x39)[0x42d2e1]
======= Memory map: ========
00400000-0062f000 r-xp 00000000 08:01 17040174                           /usr/bin/python2.7
0082e000-0082f000 r--p 0022e000 08:01 17040174                           /usr/bin/python2.7
0082f000-00897000 rw-p 0022f000 08:01 17040174                           /usr/bin/python2.7
00897000-008a9000 rw-p 00000000 00:00 0
01d28000-040e8000 rw-p 00000000 00:00 0                                  [heap]
7fa63652f000-7fa63be00000 rw-p 00000000 00:00 0
7fa63be00000-7fa63c000000 rw-s ea477000 00:05 10252                      /dev/ati/card0
7fa63c000000-7fa63c021000 rw-p 00000000 00:00 0
7fa63c021000-7fa640000000 ---p 00000000 00:00 0
7fa6400ec000-7fa6401ec000 rw-p 00000000 00:00 0
7fa6401ec000-7fa6401ed000 ---p 00000000 00:00 0
7fa6401ed000-7fa6409ed000 rw-p 00000000 00:00 0
7fa6409ed000-7fa6409ee000 ---p 00000000 00:00 0
7fa6409ee000-7fa6411ee000 rw-p 00000000 00:00 0
7fa6411ee000-7fa6411ef000 ---p 00000000 00:00 0
7fa6411ef000-7fa6419ef000 rw-p 00000000 00:00 0
7fa6419ef000-7fa6419f0000 ---p 00000000 00:00 0
7fa6419f0000-7fa6422f1000 rw-p 00000000 00:00 0
7fa6449d4000-7fa6449f3000 r-xp 00000000 08:01 17176874                   /usr/lib/python2.7/lib-dynload/_ctypes.so
7fa6449f3000-7fa644bf2000 ---p 0001f000 08:01 17176874                   /usr/lib/python2.7/lib-dynload/_ctypes.so
7fa644bf2000-7fa644bf3000 r--p 0001e000 08:01 17176874                   /usr/lib/python2.7/lib-dynload/_ctypes.so
7fa644bf3000-7fa644bf7000 rw-p 0001f000 08:01 17176874                   /usr/lib/python2.7/lib-dynload/_ctypes.so
7fa644bf7000-7fa644cf8000 rw-p 00000000 00:00 0
7fa644cf8000-7fa645555000 r-xp 00000000 00:16 12460027                   /home/.../development/root/usr/lib/libCg.so
7fa645555000-7fa645655000 ---p 0085d000 00:16 12460027                   /home/.../development/root/usr/lib/libCg.so
7fa645655000-7fa645a47000 rw-p 0085d000 00:16 12460027                   /home/.../development/root/usr/lib/libCg.so
7fa645a47000-7fa645a4e000 rw-p 00000000 00:00 0
7fa645a4e000-7fa645a85000 r-xp 00000000 00:16 12845085                   /home/.../development/root/usr/lib/OGRE/Plugin_CgProgramManager.so
7fa645a85000-7fa645c85000 ---p 00037000 00:16 12845085                   /home/.../development/root/usr/lib/OGRE/Plugin_CgProgramManager.so
7fa645c85000-7fa645c89000 r--p 00037000 00:16 12845085                   /home/.../development/root/usr/lib/OGRE/Plugin_CgProgramManager.so
7fa645c89000-7fa645c8a000 rw-p 0003b000 00:16 12845085                   /home/.../development/root/usr/lib/OGRE/Plugin_CgProgramManager.so
7fa645c8a000-7fa645ce5000 r-xp 00000000 00:16 12845086                   /home/.../development/root/usr/lib/OGRE/Plugin_OctreeSceneManager.so
7fa645ce5000-7fa645ee5000 ---p 0005b000 00:16 12845086                   /home/.../development/root/usr/lib/OGRE/Plugin_OctreeSceneManager.so
7fa645ee5000-7fa645eea000 r--p 0005b000 00:16 12845086                   /home/.../development/root/usr/lib/OGRE/Plugin_OctreeSceneManager.so
7fa645eea000-7fa645eeb000 rw-p 00060000 00:16 12845086                   /home/.../development/root/usr/lib/OGRE/Plugin_OctreeSceneManager.so
7fa645eeb000-7fa645f2e000 r-xp 00000000 00:16 12845084                   /home/.../development/root/usr/lib/OGRE/Plugin_BSPSceneManager.so
7fa645f2e000-7fa64612e000 ---p 00043000 00:16 12845084                   /home/.../development/root/usr/lib/OGRE/Plugin_BSPSceneManager.so
7fa64612e000-7fa646131000 r--p 00043000 00:16 12845084                   /home/.../development/root/usr/lib/OGRE/Plugin_BSPSceneManager.so
7fa646131000-7fa646132000 rw-p 00046000 00:16 12845084                   /home/.../development/root/usr/lib/OGRE/Plugin_BSPSceneManager.soAborted


I'm going to set up a 32 bit linux system and a win32 to test this there as well.

The non-softbody part of btogre works fine so far.
thios
Gnoblar
 
Posts: 19
Kudos: 0
Joined: 05 Feb 2011

Re: Softbody support - New bindings

Postby dermont » Thu Oct 06, 2011 4:47 am

1) The cytpes indices implementation should be c_ulong not c_int, not too sure if this will resolve your problem.

Code: Select all
        import ctypes
        _type = ctypes.c_ulong
        face_count = 3*MyMeshData.triangleCount
        indices = (_type*face_count)(0)
        ptr = ctypes.addressof(indices)

        print ctypes.sizeof(_type)
        print type(ptr), ptr.bit_length()

        ## -----------------------------
        ## MeshUtils.* meshBuffersToArrays
        ## -----------------------------
        ## a) wrapper
        ##    unsigned int indices
        ##    reinterpret_cast< long unsigned int * >( indices )
        ## b) c++
        ##    unsigned long* indices

        meshutils.meshBuffersToArrays(myMesh, MyMeshData.vertices, ptr)

        index = 0
        faces=(_type * (face_count)).from_address(ptr)
        for j in range(0,len(faces),3):

            print '(%d,%d,%d) ' %(faces[index], faces[index+1], faces[index+2])
            index+=3

        ## -----------------------------
        ## BtOgreSoftBody.* create(..)
        ## -----------------------------
        # a) wrapper
        #    unsigned int indexBuffer
        #    reinterpret_cast< unsigned int const * >( indexBuffer )
        # b) c++
        #    const unsigned int* indexBuffer

        psb = self.softBody.create(entity,MyMeshData.vertexCount, MyMeshData.vertices,face_count,ptr)



2) There appear to be a number of 64bit issues with python-ogre:
viewtopic.php?f=3&t=14510

3) Does the C++ demo run on your 64bit machine. If you need makefile etc. to build let me know.

4) I've seen similar errors to this before with libraries out of sync - but since the rest of the lib works OK I doubt this is the problem; more likely something wrong with my code.

If the demo works as expected on your machine as a temp workaround I will add some handwrapped code to encapsulate the meshBuffersToArrays/softBody->create and return a softbody (unless of course you want to have a go).

For this message the author dermont has received kudos
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby thios » Thu Oct 06, 2011 4:35 pm

Suggestion #1 worked fine. Everything else I've tested is looking good so far!
thios
Gnoblar
 
Posts: 19
Kudos: 0
Joined: 05 Feb 2011

Re: Softbody support - New bindings

Postby dermont » Sun Oct 09, 2011 10:03 am

Ok glad you got it working, the btogre module probably still needs some work.

I've made some minor updates to the bullet softbody code generators and after I finish building I'll upload to sourceforge tracker. Anything else you have come across or any nice demos you want to share for testing?

Code: Select all
btSoftBodyData 
 - added following missing classes:
    SoftBodyMaterialData
    SoftBodyNodeData
    SoftBodyLinkData
    SoftBodyTetraData
    SoftRigidAnchorData
    SoftBodyConfigData
    SoftBodyPoseData
    SoftBodyClusterData

btSoftBodyHelpers
 - added convenience funtion CreateSBFromConvexHullByList
   vertices = [bullet.btVector3(v0,v1,v2),
               bullet.btVector3(v3,v4,v5),
               .. ]                 

    softbody=bullet.CreateSBFromConvexHullByList(              
                m_softBodyWorldInfo,
                vertices,
                len(vertices),
             True)

btSoftRigidCollisionAlgorithm
 - following classes now included (both non copyable resolves btTriIndex issue)
    btSoftBodyConcaveCollisionAlgorithm
    btSoftBodyTriangleCallback

btSoftBodyFloatData
 - btSoftBodyFloatData::m_materials now wrapped as getMaterials
   b = btSoftBodyFloatData()
   matList = b.getMaterials()

btAlignedObjectArray
 - following now included:
        btAlignedObjectArray<btHashKey<btTriIndex>,btTriIndex>

        btAlignedObjectArray<btHashKey<btTriIndex>>

        btAlignedObjectArray<btTriIndex>

dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby thios » Sun Oct 09, 2011 10:23 pm

I've been working on converting my own projects from ogrebullet to btogre as a means of testing it (I'm mainly using collisions), and it's all going smoothly. Thanks again!

I also found out that it's apparently very easy to get blender models to play nice with the softbody part. You can use this exporter, and manually set use32bitindexes="True" in the .mesh.xml file.

I'll post snippets as I proceed!

EDIT: OK, I'm still not comfortable enough with softbodies to write demos about it, but here's a little something that shows some stuff about bullet and your new bindings:
-moving/scaling both physics bodies and ogre nodes with BtOgre.RigidBodyState
-raycasting with btogre/bullet

It's basically the python-ogre wiki Intermediate Tutorial #3 converted to use btogre/bullet. While I'm not using dynamics, I'm still initialising a dynamicsworld, as there's no debug drawer for btCollisionWorld. I'm also using the "official" PyCEGUI bindings instead of the ones generated with the python-ogre build system.

I hope it'll be of help to someone!

Quick question: Have you tried to build the bullet wrapper from source on windows? (So as to take advantage of the softbody support you kindly provided.)

On XP 32-bit using MSVC2008 I'm getting the following while building the bindings:

Code: Select all
cl /FoC:\temp\build_dir_2.7\bullet_rev2440\btSparseSdf_3.pypp.obj /c generated\bullet_rev2440\btSparseSdf_3.pypp.cpp /nologo /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\bullet_rev2440 -D"NDEBUG" -D"_CONSOLE" -D"WIN32" -D"_MBCS" /fp:fast /Gy /GF -Iinclude /TP /nologo /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\bullet_rev2440 -D"NDEBUG" -D"_CONSOLE" -D"WIN32" -D"_MBCS" /fp:fast /Gy /GF -Iinclude /IC:\development\boost_1_45_0 /IC:\development\bullet-2.79\src /IC:\development\bullet-2.79 /IC:\Python27\include /IC:\development\boost_1_45_0
btSparseSdf_3.pypp.cpp
C:\development\boost_1_45_0\boost/python/class.hpp(543) : error C2664: 'boost::mpl::vector2<T0,T1> boost::python::detail::get_signature<btSparseSdf<CELLSIZE>::IntFrac,btScalar>(RT (__cdecl *)(float),void *)' : cannot convert parameter 1 from 'btSparseSdf<CELLSIZE>::IntFrac ' to 'btSparseSdf<CELLSIZE>::IntFrac (__cdecl *)(T0)'
        with
        [
            T0=btSparseSdf<3>::IntFrac,
            T1=btScalar,
            CELLSIZE=3,
            RT=btSparseSdf<3>::IntFrac
        ]
        and
        [
            CELLSIZE=3
        ]
        and
        [
            CELLSIZE=3,
            T0=btScalar
        ]
        Incompatible calling conventions for UDT return value
        C:\development\boost_1_45_0\boost/python/class.hpp(614) : see reference to function template instantiation 'void boost::python::class_<W>::def_impl<btSparseSdf<CELLSIZE>,btSparseSdf<CELLSIZE>::IntFrac(__cdecl *)(btScalar),boost::python::detail::def_helper<T1>>(T *,const char *,Fn,const Helper &,...)' being compiled
        with
        [
            W=btSparseSdf<3>,
            CELLSIZE=3,
            T1=boost::python::detail::keywords<1>,
            T=btSparseSdf<3>,
            Fn=btSparseSdf<3>::IntFrac (__cdecl *)(btScalar),
            Helper=boost::python::detail::def_helper<boost::python::detail::keywords<1>>
        ]
        C:\development\boost_1_45_0\boost/python/class.hpp(244) : see reference to function template instantiation 'void boost::python::class_<W>::def_maybe_overloads<btSparseSdf<CELLSIZE>::IntFrac(__cdecl *)(btScalar),A2>(const char *,Fn,const A1 &,...)' being compiled
        with
        [
            W=btSparseSdf<3>,
            CELLSIZE=3,
            A2=boost::python::detail::keywords<1>,
            Fn=btSparseSdf<3>::IntFrac (__cdecl *)(btScalar),
            A1=boost::python::detail::keywords<1>
        ]
        generated\bullet_rev2440\btSparseSdf_3.pypp.cpp(34) : see reference to function template instantiation 'boost::python::class_<W> &boost::python::class_<W>::def<btSparseSdf<CELLSIZE>::IntFrac(__cdecl *)(btScalar),boost::python::detail::keywords<1>>(const char *,A1,const A2 &)' being compiled
        with
        [
            W=btSparseSdf<3>,
            CELLSIZE=3,
            A1=btSparseSdf<3>::IntFrac (__cdecl *)(btScalar),
            A2=boost::python::detail::keywords<1>
        ]
C:\development\boost_1_45_0\boost/python/class.hpp(544) : error C2780: 'boost::python::api::object boost::python::make_function(F,const CallPolicies &,const KeywordsOrSignature &)' : expects 3 arguments - 4 provided
        C:\development\boost_1_45_0\boost/python/make_function.hpp(115) : see declaration of 'boost::python::make_function'
C:\development\boost_1_45_0\boost/python/class.hpp(544) : error C2780: 'boost::python::api::object boost::python::make_function(F,const CallPolicies &)' : expects 2 arguments - 4 provided
        C:\development\boost_1_45_0\boost/python/make_function.hpp(108) : see declaration of 'boost::python::make_function'
C:\development\boost_1_45_0\boost/python/class.hpp(544) : error C2780: 'boost::python::api::object boost::python::make_function(F)' : expects 1 arguments - 4 provided
        C:\development\boost_1_45_0\boost/python/make_function.hpp(101) : see declaration of 'boost::python::make_function'
scons: building terminated because of errors.

10-12 17:56 PythonOgre.BuildModule DEBUG    scons: *** [C:\temp\build_dir_2.7\bullet_rev2440\btSparseSdf_3.pypp.obj] Error 2


Any insight? :)
Attachments
Demo_BtOgre_RayCasting.py.tar.gz
(3.66 KiB) Downloaded 65 times
thios
Gnoblar
 
Posts: 19
Kudos: 0
Joined: 05 Feb 2011

Re: Softbody support - New bindings

Postby dermont » Thu Oct 13, 2011 2:22 pm

Hi you "post a reply" rather than editing your old post, otherwise people may miss your additional comments.


thios wrote:I've been working on converting my own projects from ogrebullet to btogre as a means of testing it (I'm mainly using collisions), and it's all going smoothly. Thanks again!

I also found out that it's apparently very easy to get blender models to play nice with the softbody part. You can use this exporter, and manually set use32bitindexes="True" in the .mesh.xml file.

I'll post snippets as I proceed!

EDIT: OK, I'm still not comfortable enough with softbodies to write demos about it, but here's a little something that shows some stuff about bullet and your new bindings:
-moving/scaling both physics bodies and ogre nodes with BtOgre.RigidBodyState
-raycasting with btogre/bullet

It's basically the python-ogre wiki Intermediate Tutorial #3 converted to use btogre/bullet. While I'm not using dynamics, I'm still initialising a dynamicsworld, as there's no debug drawer for btCollisionWorld. I'm also using the "official" PyCEGUI bindings instead of the ones generated with the python-ogre build system.

I hope it'll be of help to someone!


Thanks I'll take a look at your demo. At the moment I'm still testing the updates using the bullet SoftBody demo, I've attached the tests and latest code_generators (full directory zipped up) - you will to back up your code_generators/bullet directory first.

thios wrote:Quick question: Have you tried to build the bullet wrapper from source on windows? (So as to take advantage of the softbody support you kindly provided.)

On XP 32-bit using MSVC2008 I'm getting the following while building the bindings:

Code: Select all
cl /FoC:\temp\build_dir_2.7\bullet_rev2440\btSparseSdf_3.pypp.obj /c generated\bullet_rev2440\btSparseSdf_3.pypp.cpp /nologo /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\bullet_rev2440 -D"NDEBUG" -D"_CONSOLE" -D"WIN32" -D"_MBCS" /fp:fast /Gy /GF -Iinclude /TP /nologo /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\bullet_rev2440 -D"NDEBUG" -D"_CONSOLE" -D"WIN32" -D"_MBCS" /fp:fast /Gy /GF -Iinclude /IC:\development\boost_1_45_0 /IC:\development\bullet-2.79\src /IC:\development\bullet-2.79 /IC:\Python27\include /IC:\development\boost_1_45_0
btSparseSdf_3.pypp.cpp
C:\development\boost_1_45_0\boost/python/class.hpp(543) : error C2664: 'boost::mpl::vector2<T0,T1> boost::python::detail::get_signature<btSparseSdf<CELLSIZE>::IntFrac,btScalar>(RT (__cdecl *)(float),void *)' : cannot convert parameter 1 from 'btSparseSdf<CELLSIZE>::IntFrac ' to 'btSparseSdf<CELLSIZE>::IntFrac (__cdecl *)(T0)'
        with
        [
            T0=btSparseSdf<3>::IntFrac,
            T1=btScalar,
            CELLSIZE=3,
            RT=btSparseSdf<3>::IntFrac
        ]
        and
        [
            CELLSIZE=3
        ]
        and
        [
            CELLSIZE=3,
            T0=btScalar
        ]
        Incompatible calling conventions for UDT return value
        C:\development\boost_1_45_0\boost/python/class.hpp(614) : see reference to function template instantiation 'void boost::python::class_<W>::def_impl<btSparseSdf<CELLSIZE>,btSparseSdf<CELLSIZE>::IntFrac(__cdecl *)(btScalar),boost::python::detail::def_helper<T1>>(T *,const char *,Fn,const Helper &,...)' being compiled
        with
        [
            W=btSparseSdf<3>,
            CELLSIZE=3,
            T1=boost::python::detail::keywords<1>,
            T=btSparseSdf<3>,
            Fn=btSparseSdf<3>::IntFrac (__cdecl *)(btScalar),
            Helper=boost::python::detail::def_helper<boost::python::detail::keywords<1>>
        ]
        C:\development\boost_1_45_0\boost/python/class.hpp(244) : see reference to function template instantiation 'void boost::python::class_<W>::def_maybe_overloads<btSparseSdf<CELLSIZE>::IntFrac(__cdecl *)(btScalar),A2>(const char *,Fn,const A1 &,...)' being compiled
        with
        [
            W=btSparseSdf<3>,
            CELLSIZE=3,
            A2=boost::python::detail::keywords<1>,
            Fn=btSparseSdf<3>::IntFrac (__cdecl *)(btScalar),
            A1=boost::python::detail::keywords<1>
        ]
        generated\bullet_rev2440\btSparseSdf_3.pypp.cpp(34) : see reference to function template instantiation 'boost::python::class_<W> &boost::python::class_<W>::def<btSparseSdf<CELLSIZE>::IntFrac(__cdecl *)(btScalar),boost::python::detail::keywords<1>>(const char *,A1,const A2 &)' being compiled
        with
        [
            W=btSparseSdf<3>,
            CELLSIZE=3,
            A1=btSparseSdf<3>::IntFrac (__cdecl *)(btScalar),
            A2=boost::python::detail::keywords<1>
        ]
C:\development\boost_1_45_0\boost/python/class.hpp(544) : error C2780: 'boost::python::api::object boost::python::make_function(F,const CallPolicies &,const KeywordsOrSignature &)' : expects 3 arguments - 4 provided
        C:\development\boost_1_45_0\boost/python/make_function.hpp(115) : see declaration of 'boost::python::make_function'
C:\development\boost_1_45_0\boost/python/class.hpp(544) : error C2780: 'boost::python::api::object boost::python::make_function(F,const CallPolicies &)' : expects 2 arguments - 4 provided
        C:\development\boost_1_45_0\boost/python/make_function.hpp(108) : see declaration of 'boost::python::make_function'
C:\development\boost_1_45_0\boost/python/class.hpp(544) : error C2780: 'boost::python::api::object boost::python::make_function(F)' : expects 1 arguments - 4 provided
        C:\development\boost_1_45_0\boost/python/make_function.hpp(101) : see declaration of 'boost::python::make_function'
scons: building terminated because of errors.

10-12 17:56 PythonOgre.BuildModule DEBUG    scons: *** [C:\temp\build_dir_2.7\bullet_rev2440\btSparseSdf_3.pypp.obj] Error 2


Any insight? :)


Sorry it's been some time since I've built on Windows, you may have to wait for Andy to do his next round of updates. I'll try and take a look this weekend, the above updates will not resolve your problem.
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby dermont » Thu Oct 13, 2011 2:49 pm

Ok uploaded the patch/tests to sourceforge, seemingly I've exceeded my Ogre forum upload quota.
https://sourceforge.net/tracker/?func=d ... tid=916690
https://sourceforge.net/tracker/?func=d ... tid=916690
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby dermont » Thu Oct 13, 2011 3:34 pm

For your Windows build problem try excluding btSparseSdf, edit bullet/generate_code.py:

Code: Select all
def ManualExclude ( mb ):

    excludes = [ 
            #'btAlignedAllocator< btSoftBody::ePSolver::_, 16u >',
            ...
             ,'btSparseSdf< 3 >'    <-----------------
            ]


It means that you can't use m_softBodyWorldInfo.m_sparsesdf but at the present moment it can't be called fully from python anyway.

Edit:
Sorry just tried the above and whilst it builds m_softBodyWorldInfo.m_sparsesdf is needed to run the demo. I'll take a look at building it at the weekend on Windows.
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby dermont » Thu Oct 13, 2011 4:24 pm

dermont wrote:For your Windows build problem try excluding btSparseSdf, edit bullet/generate_code.py:

Code: Select all
def ManualExclude ( mb ):

    excludes = [ 
            #'btAlignedAllocator< btSoftBody::ePSolver::_, 16u >',
            ...
             ,'btSparseSdf< 3 >'    <-----------------
            ]


It means that you can't use m_softBodyWorldInfo.m_sparsesdf but at the present moment it can't be called fully from python anyway.

Edit:
Sorry just tried the above and whilst it builds m_softBodyWorldInfo.m_sparsesdf is needed to run the demo. I'll take a look at building it at the weekend on Windows.


OK as a temp workaround try adding the following to the end of ManualExclude in bullet/generate_code.py:
Code: Select all
main_ns.class_('btSparseSdf< 3 >').member_functions('Decompose').exclude()
dermont
Bugbear
 
Posts: 895
Kudos: 37
Joined: 27 Sep 2005

Re: Softbody support - New bindings

Postby thios » Fri Oct 14, 2011 8:02 am

Bullet/btogre now builds and runs fine on both platforms. You're amazing.. Thanks again!
thios
Gnoblar
 
Posts: 19
Kudos: 0
Joined: 05 Feb 2011

Next

Return to Python-Ogre

Who is online

Users browsing this forum: No registered users and 1 guest

cron