Mapping vertex buffer fails after using SetMorphWeight #2495
Comments
@henningpohl How did you create the model that contains the shape keys/morphs; did you use AssImp, the Blender exporter or maybe even something else? |
I used the Blender exporter. The model does renders fine before I call |
Have you tried reproducing the issue under OpenGL? |
No, I have not. I first encountered this issue not with Urho3d, but with UrhoSharp and the C++ version already is an attempt to replicate this behavior. But I'll try to check tomorrow whether I can get it working with OpenGL. |
I'm assuming you are building the latest master, and not using the precompiled library. |
Yes, I compiled Urho3D myself (with Visual Studio 2017) |
Just checked and yes, when compiled for OpenGL it works. |
Any idea what to look for to make it work in Direct3D? For the project I'm working on OpenGL is not an option. |
I also just tried with Direct3D9 and there it also fails, but in a different way. After calling |
I do not - for me D3D is not an option - but I'm sure the information you provided will be helpful to anyone that can help you further and may look into this. |
I wonder if it is because the VB is created without "dynamic" Make sure the VB's /// Dynamic flag.
bool dynamic_{}; |
Marking this stale since there has been no activity for 30 days. |
I'm trying to use blend shapes, but it's not working for me. The model doesn't update.
I stepped through the code and when I change the weights with
SetMorphWeight
that setsmorphsDirty_
and subsequently inUpdateGeometry
theUpdateMorphs
method is called. So far so good. When I continue through that it also seems to work. However an error then occurs inside the call tobuffer->Unlock()
. More specifically, that defers toSetDataRange()
, where aMapBuffer()
call then fails.I'm using Direct3d11 and the corresponding implementation is:
HRESULT hr = graphics_->GetImpl()->GetDeviceContext()->Map((ID3D11Buffer*)object_.ptr_, 0, discard ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE, 0, &mappedData);
This results in an HRESULT 0x80070057 error -> E_INVALIDARG. I am not sure what is at fault here. The ID3D11Buffer pointer seems to be ok. At least it's not null.
The text was updated successfully, but these errors were encountered: