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

calc_tessface was removed from Mesh API in Blender 2.80 #33

Open
BTOdell opened this issue Jan 25, 2022 · 4 comments
Open

calc_tessface was removed from Mesh API in Blender 2.80 #33

BTOdell opened this issue Jan 25, 2022 · 4 comments

Comments

@BTOdell
Copy link

BTOdell commented Jan 25, 2022

calc_tessface has been removed as of Blender 2.80

https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Mesh_API

I'm not familiar at all yet with the Blender Python API so I'm still trying to figure out what this actually does and what the equivalent functions would be...

Python: Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_scene_cod\__init__.py", line 610, in execute
    result = export_xmodel.save(self, context,
  File "C:\Users\xxx\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_scene_cod\export_xmodel.py", line 382, in save
    result = save_model(self, context, filepath,
  File "C:\Users\xxx\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_scene_cod\export_xmodel.py", line 485, in save_model
    mesh_triangulate(mesh, use_vertex_cleanup)
  File "C:\Users\xxx\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\io_scene_cod\export_xmodel.py", line 49, in mesh_triangulate
    mesh.update(calc_tessface=True)
TypeError: Mesh.update(): was called with invalid keyword argument(s) (calc_tessface), expected (calc_edges, calc_edges_loose)
@CoDEmanX
Copy link
Owner

CoDEmanX commented Jan 25, 2022 via email

@BTOdell
Copy link
Author

BTOdell commented Jan 25, 2022

Yes, I converted the code to use loop_triangles in my fork (see PR #32). Although, I am worried about the tessface_vertex_colors also being removed from the Mesh API. I changed it to just vertex_colors but I don't think that's an equivalent field. It may require additional transforms to get the vertex colors of the "loop triangles".

@CoDEmanX
Copy link
Owner

CoDEmanX commented Jan 25, 2022 via email

@SE2Dev
Copy link
Collaborator

SE2Dev commented Jan 26, 2022

If memory serves, CoD2 supported vertex colors on map geometry, but not the later titles (CoD4/5). Not sure if it did for models too. The vertex colors were otherwise only used for carrying information for vertex shader effects, such as the wave shader. The colors aren't really used as colors in that case. Rather as weights, to move heavier vertices less and lighter vertices more in the wind for a realistic flag animation. Although, I can't tell for sure how that shader uses the code values as I've never seen its source code.

This is correct for CoD 5 at least. Trees, etc. used vertex colors as weights for the vertex shaders that were used to animate them if I remember correctly.

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

No branches or pull requests

3 participants