Skip to content

getArrayData doesn't support Arrays, breaks three js support #56

@mhirsch

Description

@mhirsch

In three.js if you use MeshStandardMaterial, the code path eventually calls gl.uniform3fv with an array argument. This hits webgl.cc line 49 which looks like

  if(!arg->IsNull()) {
    if(arg->IsArray()) {
      Nan::ThrowError("Not support array type");
      /*
      Local<Array> arr = Local<Array>::Cast(arg);
      if(num) *num=arr->Length();
      data = reinterpret_cast<Type*>(arr->GetIndexedPropertiesExternalArrayData());*/
    }

I see that GetIndexedPropertiesExternalArrayData is now deprecated in node. I found this comment by @mikeseven in the node repo: nodejs/node#2977 (comment)

I assume this is the problem now? In this case is it a big deal to make a copy of the buffer? Is there a good reason this was never replaced with the new API mentioned in that node issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions