simple Animation - attachObjectToBone error

Problems building or running the engine, queries about how to use features etc.
Post Reply
71puccini
Gnoblar
Posts: 14
Joined: Sun Jun 07, 2020 5:14 pm

simple Animation - attachObjectToBone error

Post by 71puccini »

Ogre Version: :1.2.18:
Operating System: :windows 10:
Render System: :DirectX11:

I am getting the following error when I try to use attachObjectToBone. Is there any example how to use attachObjectToBone?
"Error occurred during execution: Ogre::InvalidStateException::InvalidStateException: RenderSystem does not support FixedFunction, but technique of 'Sinbad/Blade' has no Vertex Shader. Use the RTSS or write custom shaders. in SceneManager::_setPass"

Code: Select all

 mSinbadEnt = mScnMgr->createEntity("Sinbad.mesh");
    mSinbadEnt->setCastShadows(true);
    mSinbadNode = mScnMgr->createSceneNode("SinbadNode");
    mSinbadNode->attachObject(mSinbadEnt);
    mScnMgr->getRootSceneNode()->addChild(mSinbadNode);
    mSinbadNode->setScale(3.0f, 3.0f, 3.0f);
    mSinbadNode->setPosition(0, 4.0, 0);

    //step1: create two instances of the sword model and name them Sword1and Sword2:
    Ogre::Entity* sword1 = mScnMgr->createEntity("Sword1", "Sword.mesh");
    Ogre::Entity* sword2 = mScnMgr->createEntity("Sword2", "Sword.mesh");
    //Now attach the sword to the model using a bone name:
    mSinbadEnt->attachObjectToBone("Handle.L", sword1);
    mSinbadEnt->attachObjectToBone("Handle.R", sword2);

71puccini
Gnoblar
Posts: 14
Joined: Sun Jun 07, 2020 5:14 pm

Re: simple Animation - attachObjectToBone error

Post by 71puccini »

It works if I use one of them at a time!

mSinbadEnt->attachObjectToBone("Handle.L", sword1);
//mSinbadEnt->attachObjectToBone("Handle.R", sword2);

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 105
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 28

Re: simple Animation - attachObjectToBone error

Post by sercero »

Have you tried using other RenderSystems other than DirectX11?

71puccini
Gnoblar
Posts: 14
Joined: Sun Jun 07, 2020 5:14 pm

Re: simple Animation - attachObjectToBone error

Post by 71puccini »

Yes. The same. Only one attachObjectToBone can be applied per entity.

paroj
OGRE Team Member
OGRE Team Member
Posts: 1222
Joined: Sun Mar 30, 2014 2:51 pm
x 487
Contact:

Re: simple Animation - attachObjectToBone error

Post by paroj »

cannot reproduce with the character sample:
https://ogrecave.github.io/ogre/emscripten/

(press Q)

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 105
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 28

Re: simple Animation - attachObjectToBone error

Post by sercero »

Try the Character Demo from the Sample Browser, in that sample Sinbad uses two swords.

I have just tried OGRE 1.12.7 and it works.

Also, please post the entire ogre.log.

71puccini
Gnoblar
Posts: 14
Joined: Sun Jun 07, 2020 5:14 pm

Re: simple Animation - attachObjectToBone error

Post by 71puccini »

The log is attached.

Code: Select all

mSinbadEnt = mScnMgr->createEntity("Sinbad.mesh");
    mSinbadEnt->setCastShadows(true);
    mSinbadNode = mScnMgr->createSceneNode("SinbadNode");
    mSinbadNode->attachObject(mSinbadEnt);
    mScnMgr->getRootSceneNode()->addChild(mSinbadNode);
    mSinbadNode->setScale(3.0f, 3.0f, 3.0f);
    mSinbadNode->setPosition(0, 4.0, 0);

    Ogre::Entity* sword1 = mScnMgr->createEntity("Sword1", "Sword.mesh");
    Ogre::Entity* sword2 = mScnMgr->createEntity("Sword2", "Sword.mesh");

    mSinbadEnt->attachObjectToBone("Handle.L", sword1);
    mSinbadEnt->attachObjectToBone("Handle.R", sword2);
thanks!
Attachments
ogre.log
(77.8 KiB) Downloaded 2 times

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 105
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 28

Re: simple Animation - attachObjectToBone error

Post by sercero »

You are getting lots of shader compilation errors:

Code: Select all

09:42:10: Ogre::RenderingAPIException::RenderingAPIException: Cannot compile D3D11 high-level shader Ogre/DualQuaternionHardwareSkinningTwoWeightsHLSL Errors:
C:\Hooman\GBC\GAME3121\Week5\Week5\DualQuaternion.hlsl(35,25-75): error X3017: 'calculateBlendPosition': cannot implicitly convert from 'float3' to 'float4'
 in D3D11HLSLProgram::compileMicrocode at C:\Hooman\GBC\GAME3121\Course Materials\GameEngineDevelopment\ogre-sdk-v2.1\RenderSystems\Direct3D11\src\OgreD3D11HLSLProgram.cpp (line 495)
09:42:10: High-level program 'Ogre/DualQuaternionHardwareSkinningTwoWeightsHLSL' is not supported: Cannot compile D3D11 high-level shader Ogre/DualQuaternionHardwareSkinningTwoWeightsHLSL Errors:
C:\Hooman\GBC\GAME3121\Week5\Week5\DualQuaternion.hlsl(35,25-75): error X3017: 'calculateBlendPosition': cannot implicitly convert from 'float3' to 'float4'
I think that you should try to fix these problems first.

You could use RTSS to generate the required shaders automatically or switch to DirectX9 so you can use the Fixed Pipeline and simplify things for now.

Post Reply