Crystal Space
Welcome, Guest. Please login or register.
April 19, 2014, 11:43:52 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7597 Members
Latest Member: Drukareczka1989
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Crystal Space Development / Support / [SOLVED] Problem with returning csRef on: June 17, 2011, 10:53:17 am
Okay, this is so embarassing,

I was just creating the code excerpt to write an answer and then I finally saw it!
The ReadFile(const char*) method haven't had a return statement at all.
It just ended with
Code:
csRef<iDocument> ReadFile(const char *filename)
{
 //...
 ReadFile(file);
}

So I guess it returned a void pointer, which caused the undefined behaviour. I wonder, why the compiler didn't warn me.

Since I haven't worked a lot with csRef, yet, I suspected the error to be caused by my reference handling, and not to be caused by a very basic programming issue.

Anyway, thanks for the quick answer and sorry for bothering!
2  Crystal Space Development / Support / Problem with returning csRef on: June 17, 2011, 08:47:30 am
Hello,

I have obviously some problems with referencing and need help:
I have written an XML parser using the iDocument Interface. It implements the method ReadFile( registry, filename) which return a csRef<iDocument>. It opens a file, queries the iDocumentSystem, creates a csRef<iDocument> via CreateDocument(), opens an iFile and use the Parse() method.

To add more convinience, I implemented the ReadFile method twice. One version with the const char* filename and one with an iFile* as parameter.
First one just opens a new iFile and return the result of the other one.

Schematically it looks like:
Code:
csRef<iDocument> ReadFile(const char* filename);
csRef<iDocument> ReadFile(iFile *file);

csRef<iDocument> ReadFile(const char* filename)
{
   // open file
   ...

   return ReadFile(file);
}

csRef<iDocument> ReadFile(iFile*)
{
  // get doc system
   ...
   csRef<iDocument> document = docsys->CreateDocuemnt();
  // do parsing and some other checks
   ...
   return document;
}

Within the ReadFile Method, I can access all nodes and so on. Everything is looking fine. But when I return to the main program, it gets lost.

Code:
// gdb shows for 'p xmldoc':
// {<CS::Memory::CustomAllocated> = {<No data fields>}, obj = 0x6}
// Note: obj is not 0, probably some garbage on the stack

// then I read the file:
  csRef<iDocument> xmldoc (  parser->ReadFile( GetObjectRegistry(), "actor/animtest.xml" ));

// here, gdb still shows for 'p xmldoc':
// {<CS::Memory::CustomAllocated> = {<No data fields>}, obj = 0x6}
// obj has not changed and is still the garbage

// so this check fails and xmldoc is considered as valid
if ( !xmldoc )
{
  printf("File Parsing not successfull\n");
}

// Not really suprising, but here gdb still shows, that obj=0x6

csRef<iDocumentNode> root = xmldoc->GetRoot();
// Boom! I get a segmentation fault

Within ReadFile, gdb shows a valid looking obj, and since I can access the nodes, I consider this as correct.

When I open the file in the main program via calling the other ReadFile(iFile*) version, it is working! So the two pass return seems to dump the reference.

I also increased the reference count manually, to test if this might be a problem, but I get the same result.

Since I work with recursions, I need to be sure, that references can be returned through two or more recursions.
I hope I just handle csRef wrong and some casting and allocating or something els might fix it. But for the moment I have no idea
So I probably handle them wrong.

Thanks in advance.
3  Crystal Space Development / Support / Re: Beginner is totally confused on: March 26, 2011, 10:42:45 pm
Hi and thanks,
this was not the answer I was hoping for.
I'll see, if I use them on the current stage. I first have to get my models ready anyway and my code.
If I take the time to look at the file and extract the syntax, I'll post it.

Thanks
4  Crystal Space Development / Support / Re: Beginner is totally confused on: March 25, 2011, 09:35:45 pm
Hey,

I got it running. I commented each <Property>-tag in each <Child> tag in data/cegui/ice.looknfeel and copied all files from data/cegui to data/viewmesh,...
It's working now! I was even able to play csbias.

BTW: For those who have the same problem and don't know how to do: Comments in XML are done by <!-- and -->
Look up all <Child> sections and comment out the tags with Property, like here:
Code:
      <Child type="ice/StaticText" nameSuffix="__auto_name__">
<!--        <Property name="FrameEnabled" value="False" />
        <Property name="BackgroundEnabled" value="False" /> -->
        <Area>
          <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
          <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
          <Dim type="Width" ><UnifiedDim scale="0.6" type="Width" /></Dim>
          <Dim type="Height" ><FontDim type="LineSpacing" padding="8" /></Dim>
        </Area>
      </Child>

I also took a deeper look into avatartest and I think I get a better feeling for Animesh now.
But is there a way to create the MorphNodes and LookAtNodes with Blender and export them via blender2crystal?
5  Crystal Space Development / Support / Re: Beginner is totally confused on: March 18, 2011, 10:35:31 pm
Thanks again, but currently working with 1.4 is fine.
Now I try to get familiar with the software interface of Animesh. Since it is a complex tree interface, I am did not really get into it, yet.
Is there a tutorial for skeletal animation or a piece of code, where I can have a look at?

Thanks
6  Crystal Space Development / Support / Re: Beginner is totally confused on: March 09, 2011, 10:30:22 pm
Hello again,

I reanimated my test model. Last time I used autokeyframe and LocRotScale. This was working fine in Blender, but not well in CS. This time I only keyed Rotation and I have 3 wonderful actions now.

But: In Viewmesh I don't succeed to combine the animations. When I add one, the previous stops but remains in the same position. E.g. I have a "grab" animation for the hand and a "wave" animation only for the arm. The arm is moving up and down, when I play "wave". When I start "grab" the arm stops where it just was and the hand starts grabbing.
(Im am currently working on 1.4 again)

Anyway, I made a model, which is working and I can continue now, working with CS.

Thanks
7  Crystal Space Development / Support / Re: Beginner is totally confused on: March 07, 2011, 09:21:26 am
Take your time!
I am not in a hurry. First I will try to fix my model and armature. I read a little bit in Blender Essential about rigging and it seems, that I made some ugly stuff anyway. So far I can work on 1.4.

Thanks
8  Crystal Space Development / Support / Re: Beginner is totally confused on: March 06, 2011, 11:18:54 pm
Okay,

it didn't take that long this time to check out. I think it was less than 20 minutes the complete trunk.
I compiled now 1.9 and I like the avatartest application. Especially Frankie looking at me.

But, I cannot run viewmesh. The reason seems to be the missing CEGUI. Ubuntu 10.4 installs 0.6.2-4 of CEGUI. I also installed the dev packages. On 1.4 CS viewmesh compiled.

I tricked Jamconfig to build with 0.6.2 but during compilation I get errors like:
Code:
/home/.../CS_latest/apps/tests/smoketest/smoketest.cpp:182: error: ‘class CEGUI::SchemeManager’ has no member named ‘create’
/home/.../CS_latest/apps/tests/smoketest/smoketest.cpp:186: error: ‘class CEGUI::FontManager’ has no member named ‘createFreeTypeFont’

Viewmesh didn't compile.
I guess 0.6.2-4 is not recent enough. But this is, what pgk-config during configure already found out.

I manually installed manually CEGUI 0.7.5 and set it for configure with "--with-CEGUI". This time it is recent enough and it compiled. I set "LD_LIBRARY_PATH" to find installed CEGUI and when I start viewmesh it says:
Code:
CEGUI::FileIOException in file CEGUIXercesParser.cpp(107) : XercesParser::parseXMLFile - An error occurred at line nr. 22 while parsing XML file 'ice.looknfeel'.  Additional information: Element 'Property' is not valid for content model: '((Area,VertAlignment,HorzAlignment),Property)'
terminate called after throwing an instance of 'CEGUI::FileIOException'
  what():  CEGUI::FileIOException in file CEGUIXercesParser.cpp(107) : XercesParser::parseXMLFile - An error occurred at line nr. 22 while parsing XML file 'ice.looknfeel'.  Additional information: Element 'Property' is not valid for content model: '((Area,VertAlignment,HorzAlignment),Property)'
Aborted

I made an svn update to get the latest version and rebuild. But still the same message.

So it might be too new and incompatible?
The doc page http://www.crystalspace3d.org/docs/online/manual/CEGUI.html sais, you need version 0.4.1 ot 0.5.0,

In the moment I'd really appreciate tools like viewmesh, since I am not advanced enough to build my own tools without CEGUI.

For export, I use blender2crystal, the tarbal on http://leapingcat.org/blender2crystal/index.php/Download I don't know, if there are differences to the svn trunk.

Thank you very much. I really made progress this weekend.

9  Crystal Space Development / Support / Re: Beginner is totally confused on: March 06, 2011, 05:36:19 pm
Hi and thanks for the fast replies!

I am currently checking out the trunk. I checked out data directory separately and it took over an hour. I don't think that's normal, since I was able to download some of the files via browser within seconds. Anyway I am currently checking out the remaining files which is exercising my patience.

On Frankie I was able to see the list of animation, but I wasn't able to play them. In this case I was just to unexperienced (nicer word for stupid). Using the "Add" button played the animations.
But using Add on my animation made viewmesh crash. I don't know what I made wrong earlier, but now it is working.

The hand animation is still corrupted, also as animesh. The bones are not directly connected (stippeled line in blender) and the original arm and armature I made with blender 2.5. The animation data was lost, when I opened it in blender 2.49 but the armature and model seemed to be the okay. In blender, the animation looks absolutely fine.

I'll soon have time to try 1.9. Maybe this fixes it. Or I connect the bones directly. I'll let you know!

Thanks
10  Crystal Space Development / Support / Beginner is totally confused on: March 05, 2011, 05:17:57 pm
Hello,

for a long time I planned to get started with some game engine stuff and CS is my first choice. Finally I found some time to get started and I am totally confused now:

1:
On your homepage there is only version 1.4 mentioned. When I google I find docs about 1.9 and in the sourceforge repository I find a release 2.0 and not 1.9.
So what is a good version to get started?

2:
Checking out the CS_latest stops when loading data/water.zip. SVN is still running, but doesn't continue. I had to kill is hard by "-9" to get it stopped. I am running Ubuntu 10.4, which should be up to date.

3:
I did the tutorials on version 1.4. But now I want to do little more advanced stuff and made my own model in blender. I already realized, that b2cs only works with 2.4, which is currently okay for me.
It's an animated arm, which is waving. As genmesh, I can see it in viewmesh waving. As animesh, it is holding still. I created an action "wave" in NLA editor, but it is still not waving. In the "Ani" slide I see a list, containing "default" and "wave". But I cannot start it.
It seems this guy here http://www.crystalspace3d.org/forum/index.php/topic,1164.0.html had the same problem, but doesn't print his answer.
BTW: Loading Frankie in viewmesh, doesn't show any animation, too.
Since I can find a file "animesh.so" I guess it has compiled, correctly.

4:
As genmesh, the animation in viewmesh is corrupted. The hand is translating strangely. In blender it is looking fine.

Thanks in advance
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 7.206 seconds with 17 queries.