Crystal Space
 Welcome, Guest. Please login or register. November 18, 2017, 08:20:38 pm 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length
9081 Posts in 2051 Topics by 80411 Members
Latest Member: Uyomkew
 Pages: [1]
 Author Topic: Could not load cal3d model using viewmesh  (Read 4400 times)
willjm
Newbie

Posts: 39

 « on: February 20, 2008, 05:38:08 am »

Hello all,

I am attempting to load a model that was created using Blender 3D and exported to cal3d format. When I attempt to load the model an error message is displayed.

Quote
[node: meshfact(name=hydrant_dirty),params,skeleton]

After clicking the Ok button I receive another pop up message.

Quote
crystalspace.mesh.sprite.cal3d: Cal3d: No error found in (-1

I have placed the model in the following path: C:\CS\data\cal3d_models\hydrant

In that directory I have the following files:
hydrant_dirty.cal3d
hydrant_dirty.cmf
hydrant_dirty.crf
hydrant_dirty.csf
hydrant_dirty.cfg

This is the contents of my hydrant_dirty.cal3d file.

Code:
<!-- The meshfact name is the CS name used to create
instances of this object. -->
<meshfact name="hydrant_dirty">

<!-- The plugin line specifies the plugin to use to parse
the succeeding 'params' tag. -->

<params>
<options rotate_x_axis="no" flip_textures="no" />

<!-- Path specifies the OS-dependent directory path to
where all the other files are located. (optional) -->
<path dir="/model/hydrant/" />

<!-- The cally model is much too large. -->
<scale value="0.25" />

<!-- Specify cal3d skeleton file used by model. -->
<skeleton file="hydrant_dirty.csf"/>

<!-- Animations specify the filename to load, and the
CS-accessible name of this animation.  The type attribute
is used to distinguish various types of animations.
Recognized types are "idle", "travel", "cycle",
"style_cycle", and "action". base_vel specifies the
speed of translation which should be used when the
animation is playing alone.  min_vel and max_vel are
used by the blender to achieve a specified desired
velocity.  min_random and max_random are interval to be
used in idle override actions, in seconds.  idle_pct is a
number between 0 and 100, which is the % probability
of that action being the override action. -->
<!-- None Specified Right Now -->

<!-- Materials are VFS filenames because they are CS
materials and not cal3d materials. (optional) We
can not use the real .xrf files because CS can't load
that format.  -->
<material file="/model/hydrant/textures/hydrant_dirty.png" name="skin" />

<!-- Meshes specify each attachable part of the model.
The name is the CS-accessible name which will be used
to select/deselect it for the model.  The material
specified is the default CS material used by this
mesh.  -->
<mesh file="hydrant_dirty.cmf" name="hydrant_dirty" material="/model/hydrant/textures/hydrant_dirty.png" />

<!-- The following rotates the model and all animations around
the Y axis by 180 degrees.  Any axis and angle may be
specified, and translation may also be specified. -->
<!--
<hardtransform
rot_axis_x="1"
rot_axis_y="0"
rot_axis_z="0"
rot_angle="270" />
<hardtransform
rot_axis_x="0"
rot_axis_y="1"
rot_axis_z="0"
rot_angle="180" />
-->
</params>
</meshfact>

I have placed and entry in vfs.cfg to provide the correct location to the cal3d data for this model to the virtual file system:
Code:
VFS.Mount.model/beach_ball = $@data$/cal3d_models$/hydrant$/

I'm not sure where I'm going wrong. I have read this page (http://www.crystalspace3d.org/docs/online/manual/MeshObject-SprCal3D.html) that suggests that the skeleton name is incorrect. Maybe I'm blind and don't see something obvious. Some help getting this model loading in viewmesh would be much appreciated.

 Logged
willjm
Newbie

Posts: 39

 « Reply #1 on: February 21, 2008, 05:42:22 am »

OK, I found the culprit in my .cal3d file that was causing my grief. I still don't know why but when I find out I'll post again.

I simply commented out this line and I could view my model in viewmesh

Code:
<path dir="/model/hydrant/" />

Well... now that I just suspected my entry into the vfs.cfg file... I should have noticed the glaring mistake that is posted in my original message.

Code:
VFS.Mount.model/hydrant = $@data$/cal3d_models$/hydrant$/

works much better than

Code:
VFS.Mount.model/beach_ball = $@data$/cal3d_models$/hydrant$/

So much for copy, paste and modify.

Embarrassing, but solved.
 Logged
 Pages: [1]