react-three-renderer icon indicating copy to clipboard operation
react-three-renderer copied to clipboard

Warning: updating prop geometry ( [object Object] ) for LineDescriptor

Open jugglingcats opened this issue 8 years ago • 4 comments

Not sure if this is a minor bug or if I'm doing something wrong. I noticed another module had this issue and it was fixed (#59).

Here is my code:

    render() {
        var geometry = new THREE.Geometry();
        geometry.vertices = this.state.lines;

        return (
            <React3 ref={'react3'} width={800} height={500} clearColor={0xf0f0f0} mainCamera="camera">
                <scene>
                    ...
                    <line geometry={geometry} material={ new THREE.LineBasicMaterial({ color: 0x0000ff })}/>
...

jugglingcats avatar Nov 18 '16 11:11 jugglingcats

Thanks for the report, I will be able to take a look early Saturday :)

On Fri, Nov 18, 2016, 11:54 jugglingcats [email protected] wrote:

Not sure if this is a minor bug or if I'm doing something wrong. I noticed another module had this issue and it was fixed (#59 https://github.com/toxicFork/react-three-renderer/issues/59).

Here is my code:

render() {
    var geometry = new THREE.Geometry();
    geometry.vertices = this.state.lines;

    return (
        <React3 ref={'react3'} width={800} height={500} clearColor={0xf0f0f0} mainCamera="camera">
            <scene>
                ...
                <line geometry={geometry} material={ new THREE.LineBasicMaterial({ color: 0x0000ff })}/>

...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/toxicFork/react-three-renderer/issues/128, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0iLUfRZz6veZwTnjfpCdaEr7ucc-Evks5q_ZIEgaJpZM4K2Z8o .

toxicFork avatar Nov 18 '16 12:11 toxicFork

@jugglingcats it looks like we do not handle the geometry nor material properties for line or its parent class mesh.

Please do this instead:

<line>
    <lineBasicMaterial color={0x0000ff} />
    <geometry vertices={this.state.lines}/>
</line>

toxicFork avatar Nov 20 '16 17:11 toxicFork

I made the change you suggested and error messages are gone! Thanks.

Strange that it was drawing the line at all using the attributes...?

jugglingcats avatar Nov 20 '16 18:11 jugglingcats

Yes it'd work but it gives warnings because they are not being handled in an efficient way, every time you changed it it would re-create the components

toxicFork avatar Nov 20 '16 19:11 toxicFork