Spoiler alert, this is not actually a blog post about a man creating a real life cookie with an amusing twist at the end, I'm just using it to test how blog posts will be written and stuff like that. Spoiler alert but that's life, a series of cookie related promises followed by unsympathetic disappointment and, spoiler alert, no cookies.
Here is a code snippet showing how to remove duplicate objects in blender using python - this is mainly to test out styling code snippets
in the blog posts
import bpy
#get all scene objects
objs = [i for i in bpy.data.scenes[0].objects if i.type == 'MESH']
for i in objs:
#check for objects that have one material
if len(i.material_slots)==1:
dupmat = i.material_slots[0].name
print(dupmat)
#check for duplicate names
if ".0" in dupmat:
matName = dupmat[:-4]
if matName in [i.name for i in bpy.data.materials]:
mat = bpy.data.materials[dupmat[:-4]]
i.material_slots[0].material = mat
#check for objects that have more than one material
elif len(i.material_slots)>1:
for x,y in enumerate(i.material_slots):
dupmat = i.material_slots[x].name
print(dupmat)
if ".0" in dupmat:
matName = dupmat[:-4]
if matName in [i.name for i in bpy.data.materials]:
mat = bpy.data.materials[dupmat[:-4]]
i.material_slots[x].material = mat
Here's an embedded map of the Brighton Window and Gutter Cleaning services provided by someone in Brighton.
Notice how the corners of the code block are very sharp and therefore not rounded? This is not what I intended, the code block should inherit the style of a styled code block which has the following properties:
This tells me that the styling does not work for code blocks in CMS content. What does this tell us?
Code blocks do not inherit styling from the Rich Text Editor when used in CMS content without custom CSS
Further examples of this can be found in the following study by Zongker et al. 2002 which outlines an important use case and should not be ignored.
Vivamus vitae arcu vel velit efficitur vestibulum vel in purus. Vivamus vitae arcu vel velit efficitur vestibulum vel in purus. Sed auctor augue id tellus lacinia, nec ultricies est fermentum.
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae. Sed auctor augue id tellus lacinia, nec ultricies est fermentum.
Zongker, D et al. "Chicken Chicken Chicken: Chicken Chicken." Department of Computer Science and Engineering, University of Washington. 2002
And yeah that's pretty much it, hope you enjoyed my blog post and all the various code snippets,
of which there were very few which is not necessarily a bad thing, don't you agree?
I personally find that large swathes of text in code format are sometimes hard to read but sometimes large swathes of text written in code snippet format can be a pleasant thing to read so it just goes to show there are two sides to every cookie.
👍
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
code looks like this
import bpy
#get all scene objects
objs = [i for i in bpy.data.scenes[0].objects if i.type == 'MESH']
for i in objs:
#check for objects that have one material
if len(i.material_slots)==1:
dupmat = i.material_slots[0].name
print(dupmat)
#check for duplicate names
if ".0" in dupmat:
matName = dupmat[:-4]
if matName in [i.name for i in bpy.data.materials]:
mat = bpy.data.materials[dupmat[:-4]]
i.material_slots[0].material = mat
#check for objects that have more than one material
elif len(i.material_slots)>1:
for x,y in enumerate(i.material_slots):
dupmat = i.material_slots[x].name
print(dupmat)
if ".0" in dupmat:
matName = dupmat[:-4]
if matName in [i.name for i in bpy.data.materials]:
mat = bpy.data.materials[dupmat[:-4]]
i.material_slots[x].material = mat
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Block quote
Ordered list
Unordered list
Bold text
Emphasis
Superscript
Subscript