slipster216 / VertexPaint

Unity 5.3 Vertex Painter
Other
906 stars 151 forks source link

VertexInstanceStream added on every meshes ! #12

Closed apautrot closed 7 years ago

apautrot commented 7 years ago

While the tool window is opened, the tool is automatically adding component VertexInstanceStream to any selected GameObject and all its hierarchy !

In class VertexPainterWindow : property public VertexInstanceStream stream { get { ... _stream = meshFilter.gameObject.AddComponent(); ... } }

This is madness...

slipster216 commented 7 years ago

It should only add it to ones with mesh renderers and only add it when you paint on that mesh... Maybe that filter isn't working?

On Thu, Oct 20, 2016 at 11:35 AM, apautrot notifications@github.com wrote:

While the tool window is opened, the tool is automatically adding component VertexInstanceStream to any selected GameObject and all its hierarchy !

In class VertexPainterWindow : property public VertexInstanceStream stream { get { ... _stream = meshFilter.gameObject.AddComponent(); ... } }

This is madness...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhexi4wmau4-h2QQ3-vdjaIEOH17a4ks5q14o5gaJpZM4KcRjQ .

slipster216 commented 7 years ago

Eh, yeah, it's being overly aggressive. Trying to rework it a bit to make it more conservative now- and still keep the flow simple to work with.

I can either:

a) Be aggressive with adding these components and attempt to clean them up when they aren't needed.

b) Not be aggressive, and introduce a few more edge cases starting the process..

Both have issues; with the first, you might save the scene, etc, with the components still around.

With the second, you can't do things like preview the vertex data until you either a) add the component manually or b) paint, which is a little awkward since you usually want to see the preview before you paint..

grr..

On Thu, Oct 20, 2016 at 11:39 AM, Jason Booth slipster216@gmail.com wrote:

It should only add it to ones with mesh renderers and only add it when you paint on that mesh... Maybe that filter isn't working?

On Thu, Oct 20, 2016 at 11:35 AM, apautrot notifications@github.com wrote:

While the tool window is opened, the tool is automatically adding component VertexInstanceStream to any selected GameObject and all its hierarchy !

In class VertexPainterWindow : property public VertexInstanceStream stream { get { ... _stream = meshFilter.gameObject.AddComponent(); ... } }

This is madness...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhexi4wmau4-h2QQ3-vdjaIEOH17a4ks5q14o5gaJpZM4KcRjQ .

slipster216 commented 7 years ago

Ok, I went with #2 and added some buttons to make it a bit easier to manage. Let me know if you see any issues with the changes; there's not really a great way to deal with all the temporary state in Unity..

On Thu, Oct 20, 2016 at 2:00 PM, Jason Booth slipster216@gmail.com wrote:

Eh, yeah, it's being overly aggressive. Trying to rework it a bit to make it more conservative now- and still keep the flow simple to work with.

I can either:

a) Be aggressive with adding these components and attempt to clean them up when they aren't needed.

b) Not be aggressive, and introduce a few more edge cases starting the process..

Both have issues; with the first, you might save the scene, etc, with the components still around.

With the second, you can't do things like preview the vertex data until you either a) add the component manually or b) paint, which is a little awkward since you usually want to see the preview before you paint..

grr..

On Thu, Oct 20, 2016 at 11:39 AM, Jason Booth slipster216@gmail.com wrote:

It should only add it to ones with mesh renderers and only add it when you paint on that mesh... Maybe that filter isn't working?

On Thu, Oct 20, 2016 at 11:35 AM, apautrot notifications@github.com wrote:

While the tool window is opened, the tool is automatically adding component VertexInstanceStream to any selected GameObject and all its hierarchy !

In class VertexPainterWindow : property public VertexInstanceStream stream { get { ... _stream = meshFilter.gameObject.AddComponent(); ... } }

This is madness...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhexi4wmau4-h2QQ3-vdjaIEOH17a4ks5q14o5gaJpZM4KcRjQ .

apautrot commented 7 years ago

Hi

The component is added to any mesh (and full hierarchy under) at first selection ( InitMeshes will init PaintJob[] that will assign original material to stream, and accessing stream property will auto create VertexInstanceStream component ). Just put a breakpoint in stream property getter, open the Vertex Paint window and select any object to reproduce.

Personally I would prefer the editor window to tell me "There is no VertexInstanceStream component associated to the selected object. Would you like to add one ?" and have a button to manually add this component so that I control which object has VertexInstanceStream component on it, because it has side effects. I have detected those tons of VertexInstanceStream everywhere in my scene because one side effect was to conflict with my other components when dynamically updating mesh vertices.

Another issue : because you add the component but do not raise any modification on the object ( using Undo or EditorUtility ) the modification flag isn't raised on file you edit. With side effect that you could lose your painting job if you don't do another editing action that raise it, as Ctrl+S will do nothing on a file that is not marked as edited.

Regards.

2016-10-20 17:39 GMT+02:00 Jason Booth notifications@github.com:

It should only add it to ones with mesh renderers and only add it when you paint on that mesh... Maybe that filter isn't working?

On Thu, Oct 20, 2016 at 11:35 AM, apautrot notifications@github.com wrote:

While the tool window is opened, the tool is automatically adding component VertexInstanceStream to any selected GameObject and all its hierarchy !

In class VertexPainterWindow : property public VertexInstanceStream stream { get { ... _stream = meshFilter.gameObject.AddComponent(); ... } }

This is madness...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhexi4wmau4-h2QQ3- vdjaIEOH17a4ks5q14o5gaJpZM4KcRjQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12#issuecomment-255143218, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXdo5yIIUzpEMvzAf-GAdzkcGOm86LCks5q14sygaJpZM4KcRjQ .

slipster216 commented 7 years ago

Did you get latest? I fixed both of these last week..

On Tue, Oct 25, 2016 at 2:26 PM, apautrot notifications@github.com wrote:

Hi

The component is added to any mesh (and full hierarchy under) at first selection ( InitMeshes will init PaintJob[] that will assign original material to stream, and accessing stream property will auto create VertexInstanceStream component ). Just put a breakpoint in stream property getter, open the Vertex Paint window and select any object to reproduce.

Personally I would prefer the editor window to tell me "There is no VertexInstanceStream component associated to the selected object. Would you like to add one ?" and have a button to manually add this component so that I control which object has VertexInstanceStream component on it, because it has side effects. I have detected those tons of VertexInstanceStream everywhere in my scene because one side effect was to conflict with my other components when dynamically updating mesh vertices.

Another issue : because you add the component but do not raise any modification on the object ( using Undo or EditorUtility ) the modification flag isn't raised on file you edit. With side effect that you could lose your painting job if you don't do another editing action that raise it, as Ctrl+S will do nothing on a file that is not marked as edited.

Regards.

2016-10-20 17:39 GMT+02:00 Jason Booth notifications@github.com:

It should only add it to ones with mesh renderers and only add it when you paint on that mesh... Maybe that filter isn't working?

On Thu, Oct 20, 2016 at 11:35 AM, apautrot notifications@github.com wrote:

While the tool window is opened, the tool is automatically adding component VertexInstanceStream to any selected GameObject and all its hierarchy !

In class VertexPainterWindow : property public VertexInstanceStream stream { get { ... _stream = meshFilter.gameObject.AddComponent(); ... } }

This is madness...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12, or mute the thread https://github.com/notifications/unsubscribe- auth/AMFhexi4wmau4-h2QQ3- vdjaIEOH17a4ks5q14o5gaJpZM4KcRjQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12#issuecomment- 255143218, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXdo5yIIUzpEMvzAf- GAdzkcGOm86LCks5q14sygaJpZM4KcRjQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12#issuecomment-256126569, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhe-aU2Fnc7WZSmi6MtS5OdCo1k1iCks5q3knagaJpZM4KcRjQ .

apautrot commented 7 years ago

Hi Jason,

I've seen that you did a fix. Presently I didn't have enough time to get and test it, but I'll be probably more available this week end to do it.

2016-10-25 23:56 GMT+02:00 Jason Booth notifications@github.com:

Did you get latest? I fixed both of these last week..

On Tue, Oct 25, 2016 at 2:26 PM, apautrot notifications@github.com wrote:

Hi

The component is added to any mesh (and full hierarchy under) at first selection ( InitMeshes will init PaintJob[] that will assign original material to stream, and accessing stream property will auto create VertexInstanceStream component ). Just put a breakpoint in stream property getter, open the Vertex Paint window and select any object to reproduce.

Personally I would prefer the editor window to tell me "There is no VertexInstanceStream component associated to the selected object. Would you like to add one ?" and have a button to manually add this component so that I control which object has VertexInstanceStream component on it, because it has side effects. I have detected those tons of VertexInstanceStream everywhere in my scene because one side effect was to conflict with my other components when dynamically updating mesh vertices.

Another issue : because you add the component but do not raise any modification on the object ( using Undo or EditorUtility ) the modification flag isn't raised on file you edit. With side effect that you could lose your painting job if you don't do another editing action that raise it, as Ctrl+S will do nothing on a file that is not marked as edited.

Regards.

2016-10-20 17:39 GMT+02:00 Jason Booth notifications@github.com:

It should only add it to ones with mesh renderers and only add it when you paint on that mesh... Maybe that filter isn't working?

On Thu, Oct 20, 2016 at 11:35 AM, apautrot notifications@github.com wrote:

While the tool window is opened, the tool is automatically adding component VertexInstanceStream to any selected GameObject and all its hierarchy !

In class VertexPainterWindow : property public VertexInstanceStream stream { get { ... _stream = meshFilter.gameObject.AddComponent(); ... } }

This is madness...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12, or mute the thread https://github.com/notifications/unsubscribe- auth/AMFhexi4wmau4-h2QQ3- vdjaIEOH17a4ks5q14o5gaJpZM4KcRjQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12#issuecomment- 255143218, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXdo5yIIUzpEMvzAf- GAdzkcGOm86LCks5q14sygaJpZM4KcRjQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12#issuecomment- 256126569, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhe- aU2Fnc7WZSmi6MtS5OdCo1k1iCks5q3knagaJpZM4KcRjQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/12#issuecomment-256188465, or mute the thread https://github.com/notifications/unsubscribe-auth/AEXdo17JSiHWRK_W3lWn9_w1rpYKLwohks5q3nsLgaJpZM4KcRjQ .