Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeping the existing material on objects #2

Closed
meah opened this issue Feb 2, 2017 · 6 comments
Closed

Keeping the existing material on objects #2

meah opened this issue Feb 2, 2017 · 6 comments
Labels

Comments

@meah
Copy link

meah commented Feb 2, 2017

hi, i tried this script and it was great, what i want is to keep the material that i already have in my 3D objects

@Shinao
Copy link

Shinao commented Apr 5, 2017

In ClippableObject.cs - Remove the two lines inside OnEnable and put
renderer.sharedMaterial.shader = Shader.Find("Custom/StandardClippable");
It will automatically try to transfer everything to the new shader.

@meah
Copy link
Author

meah commented Apr 17, 2017

thank you, it was helpfull, did you know how we can ignore the collider of clipped side ??
we already tried a script that cut the object using the plane but that one take lot of time to validate all meshes

@Shinao
Copy link

Shinao commented Apr 17, 2017

Nope sorry. Actually I stopped using this shader and created my own, seems counter intuitive to recreate the whole standard shader.
Honestly the only way to do what you want I think is to move and resize your collider while you move the clip planes. But yeah, could be cpu intensive.

@meah
Copy link
Author

meah commented Apr 17, 2017

it will not work if i only move or resize the collider because i'm using the mesh collider
thanks for your help

@toxicFork
Copy link
Collaborator

Unfortunately with colliders we may not have the same flexibility as it goes into PhysX which may not allow it :(

@toxicFork toxicFork changed the title 3d object matrerial Keeping the existing material on objects Oct 15, 2017
@ShapeGroup
Copy link

hi!

If you can ... apply the script to a null container and make the cutting plane follow the container ... or it's almost useless because you have to always move the plane and it does not work on more meshes together

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants