text:
Glass reflection not connected to environment
I’m trying to replicate the reflection effect given by blender’s default ext image (specifically studio.exr) strength 1600 world opacity 1000 and blur 0.50, where the background is blurred but reflections on the object are clear, giving also different type of shadows to objects. I’ve tried blurring the original exr in photoshop and using it as an environment texture but then realized reflections are from the blurred exr which is not what I wanted. Is there any way around to disconnect reflections to object so that I could have the 2 exr separated, 1 as the background (the blurred) and the other one (the clear) as the reflective ?

You can use the setup in my answer here: Material and rendering preview to blur the background for the camera and not the reflections. The good thing here is, you can switch the HDRI to your liking without the need to prepare a blurred one beforehand. This way you also only need to provide the memory space for one image... and you can change the blurriness if you want more or less. But I have to admit that the answer given here renders faster.

Thanks for the answer, I actually figured it out by using uv reflection > base color in the object shader

Use the Is Glossy Ray output of an Input > Light Path node as factor in a Mix Shader that mixes your 2 HDRI images:

Thanks for the answer, I actually figured it out by using uv reflection > base color in the object shader


text:
Sculpting is erasing everything
I'm trying to follow this tutorial https://www.youtube.com/watch?v=SVf-UvySGqI but when I try to use the sculpt brush it just erases everything under it. Any idea how to fix that?

What do you mean by "erases everything under it"?

It just removes everything that is under the brush, like it's digging a hole like on the picture atttached.

Are you sure you are not holding down the ctrl key while doing it. Coz although the brush is set to add, if you hold down ctrl, it will subtract. That might be the issue.

It's possible that you have inverted normals. Try checking 'Face Orientation' on the Viewport Overlays menu and see if any of the object is red. (It should be all blue.)

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How to change the final frame for a looping camera view
the looping after linking the path of the camera with the circle curve, ends at 100. How can I change that to 250 or just infinity (infinite loop) ?

https://blender.stackexchange.com/questions/118290/continuous-looping-animation-differing-rotational-speeds

Instead of using a circle curve (which is much more complicated) i would propose to add an empty at the place where you would normally have the center of your circle.
Then make the empty the parent of your camera.
Then just animate the rotation of your empty -> and you got a perfect circle for your cam movement.
For the animation e.g. if you want to animate the z-rotation value, go to frame 1 and hover of the z-rotation value of the empty and press I.
Then go to your last frame, hover of the z-rotation value and enter 360. Press I again.
So you have an infinity loop if you play the animation.
To make the looping cycle perfect hover over the timeline, press V and then choose linear so that the rotation speed is always constant.
if you want it your way, you can change the frame in the curve here:
Path animation -> frames

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How can I list all the matcaps and studio lights via python?
I'm currently working on new addon for blender 2.8 but I got stuck because I need to find a way to list all the Matcaps and Studio lights installed inside blender.
I'm using this to list all the matcaps and studioligths installed in blender:
import bpy

lights= bpy.context.preferences.studio_lights

list_lights=[]

list_lights.append(tuple(lights))

print(list_lights)

and It works that list all the studio ligths and matcaps, but with this structure:
<bpy_struct, StudioLight("basic_1.exr")>, StudioLight("03_Three_Points.sl")>...

and I would like to have only the name and the type of the light something like this:
['basic_1.exr'], ['03_Three_Points.sl']...

Hopefully someone could bring me some help
Thank you so much in advance

What you are seeing is the string representation of a blender class instance, for example the context scene object.
>> str(C.scene)
'<bpy_struct, Scene("Scene")>'

In this case an object of type bpy.types.StudioLight
Of particular interest the  name and type property.
>>> for sl in C.preferences.studio_lights:
...     sl.name, sl.type
...
('Default', 'STUDIO')
('basic_1.exr', 'MATCAP')
('basic_2.exr', 'MATCAP')
('basic_dark.exr', 'MATCAP')
('basic_side.exr', 'MATCAP')

For example to make a dictionary with the type as the key to a list of the names of all of that type:
>>> from collections import defaultdict
>>> studio_lights = defaultdict(list)
>>> for sl in C.preferences.studio_lights:
...     studio_lights[sl.type].append(sl.name)
...

What types are there?
>>> studio_lights.keys()
dict_keys(['STUDIO', 'MATCAP', 'WORLD'])

All those of type 'MATCAP'
>>> studio_lights['MATCAP']
['basic_1.exr', 'basic_2.exr', 'basic_dark.exr', 'basic_side.exr', 'ceramic_dark.exr', 'ceramic_lightbulb.exr', 'check_normal+y.exr', 'check_reflection.exr', 'check_rim_dark.exr', 'check_rim_light.exr', 'clay_brown.exr', 'clay_muddy.exr', 'clay_studio.exr', 'jade.exr', 'metal_anisotropic.exr', 'metal_carpaint.exr', 'metal_lead.exr', 'metal_shiny.exr', 'pearl.exr', 'resin.exr', 'skin.exr', 'toon.exr']

This help me a lot thank you so much!!!!


text:
Why does 'bpy.context.object' return 'None' when accessed by an operator in a panel?

I wanted to switch between Display modes with hot keys.
And I decided to write my own operator for this and create a small add-on to be able to start using hot keys and switch between these modes.
The operator itself works.
import bpy

def main(context):
    bpy.context.object.display_type = 'TEXTURED'
    #bpy.ops.mesh.primitive_plane_add(enter_editmode=False, location=(0, 0, 0))

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        main(context)
        return {'FINISHED'}

But when I started working with creating a button for my operator, there were problems.
class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout

        scene = context.scene

        # Big render button
        layout.label(text="Big Button:")
        row = layout.row()
        row.scale_y = 1.0
        row.operator("object.simple_operator")

def register():
    bpy.utils.register_class(SimpleOperator)
    bpy.utils.register_class(LayoutDemoPanel)

def unregister():
    bpy.utils.unregister_class(SimpleOperator)
    bpy.utils.unregister_class(LayoutDemoPanel)

if __name__ == "__main__":
    register()

When I click on the button to apply my operator, an error appears:
    Error: Traceback (most recent call last):
  File "\ui_panel.py", line 31, in execute

  File "\ui_panel.py", line 16, in main
    bpy.context.object.display_type = 'TEXTURED'

AttributeError: 'NoneType' object has no attribute 'display_type'

location: <unknown location>:-1

What is the problem? Why, if you call the operator directly, then it works, and if through the button it throws an error? Why is this happening and how to fix it?

For some reason bpy.context.object return None in script with button what call operator while if execute operator itself with debugging bpy.context.object it return selected object

I solve the problem, start from beginng creating the same script and it works, I did not fully understand what was the problem, but now it works

I start new try with templates, there are differences in poll function
@classmethod     def poll(cls, context):         return context.active_object is not None

Maybe the problem was this

When accessing the context from the operator, you should use the context passed as a parameter of your method, not bpy.context since those can be different

change following line in Panel
bl_context = "scene"

to
bl_context = "object"

context passed to draw function in Panels contains current active object only in object specific sections like 'object','data','physics','constraints' etc.

Would say this is also  specific to buttons context or the PROPERTIES area.  Other workarounds would be i) if the panel is for scene context then consider using context.active_object ii)  set the context pointer UILayout.context_pointer_set("object", context.active_object) to have context.object visible to operators.

IIRC it also has something to do with area.pin_id


text:
How to I bake the displacement texture on an image?
Ultimately, I'm trying to bake the displacement map to actually deform the mesh of an object.
In the end, I should end up with a baked displacement texture, and use it in a "displace" modifier to deform the mesh
I'm following this tutorial that shows how to do that
https://youtu.be/H51zh25KGGY?si=oDOyCmxZtLDdnZ8F
My only issue is the part where I need to bake the displacement texture on an image texture. I need to un-wrap the UV so it fits within the bounds of the UV map. But by doing that, it makes my UV scaled up like crazy, which is definitely not what I want.
Exemple:

What the texture should look like. (on the right)

Nodes:

Does anyone know how I can work around this issue?
Here is my blend file, for anyone interested
https://we.tl/t-OMTSDZ3PRF

So your question is not about baking, more about the UV that is too big? What you could do is playing with the scale of the Mapping node, to do that, plug an Input Value into the Scale input of the Mapping and play with the value? If this is not your problem, could you please elaborate?

@moonboots
Changing the scale was the solution, thanks.

Why do you want to bake your displacement?  You already have an image with the displacement you want.  You're not changing your mapping or anything.  You can use the existing displacement texture in a displacement modifier.

If you don't want to change the UV islands size, you could play with the Scale values of the Mapping node. To make it simpler, plug an (Input) Value node into the Scale input of the Mapping node and play with the value:


text:
Animating a 3d model in Blender
I am new to Blender.  I have a model of a Hopper Car used in Model Railroading created in Fusion360.  I would like to have this model follow the rails.  I would like car to be able to follow the curve in the rails left or right and up and down.  Below is what the model looks like.

The track in front of the car curves right them left.  The Track behind the car curves up and down.  How would I go about animating this in Blender?

Hi. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue in such way that anyone searching for a similar problem is likely to find it. Use the [edit] link above, remove anything superfluous, avoid words like "this", "help", "issue with" or "question about". Remember, your title is the first thing potential visitors see, answers you get depend heavily on how insightful it is. See What is the problem of asking “How do I do this?"

That's not really something a complete beginner to Blender should be attempting. You really want to add a Curve > Path object and get the car to follow that but there aren't any real beginner tutorials showing how to do that.

https://blender.stackexchange.com/questions/133012/line-of-bones-to-travel-and-conform-to-curve-train-or-snake-following-path https://blender.stackexchange.com/questions/81872/how-to-rig-a-truck-trailer-so-that-the-trailer-follows-the-truck https://blender.stackexchange.com/questions/19675/creating-a-trailer-rig https://blender.stackexchange.com/questions/255896/need-solution-for-train-following-curve-bone-rigging-constraints https://blender.stackexchange.com/questions/268061/how-to-keep-train-wheels-aligned-to-tracks

Hello and welcome. This question seems to have been asked before in multiple forms over time, and already has various answers but you never acknowledged any of them. We are not sure if you aware of the existing posts but none of the described techniques address your particular requisites, or you simply didn't do any research at all. Could you [edit] you post and clarify how your question differs from the suggested duplicates? Otherwise could you rephrase it to focus on a particular step you are stuck with?


text:
Image sequence into animation
How can I convert image sequence into animation in blender and export it as .blend file?

In the Video Sequencer in Sequencer mode you can press A > Image/Sequence and it will load a series of images, you'll be able to see it in the Video Sequencer in Preview mode, is it what you want? Except you can't pack the loaded images, you need to keep them in their folder

Can you please send me any document/video/tutorial for this? I tried to do it but did not succeed.

Do you have a series of pictures that are named image1.png, image2.png, etc? You need to search for a tutorial like this one I guess: https://www.youtube.com/watch?v=jRsYkp3GoK0


text:
How to add faces to object made with screw modifier?
I just started learning Blender and I made a simple chess pawn using screw modifier (followed Grant Abbitt tutorial). Now I want to make UV map to use it in Unity with wood material but it doesn't have faces atm.
How do I add/generate faces for this object?

https://blender.stackexchange.com/questions/74428/how-to-unwrap-a-mesh-generated-with-screw

You need to apply the modifier?

You need to apply the modifier if you want the UVs:


text:
Striped artifacts on object when applying metalness-map to shader-node
i hope you can help me with this.
So i have the problem that my model gets striped artifacts when applying a metalness map I baked out of Substance Designer in the shader node, or even when no metalness-map is attached but i dial in some metallnes via the shader parameter.
I never had this odd behavior before and i don't know where this is coming from.
See attached screenshots for a visual

As you can see the image file itself does not seem to be the problem...

Hi, @Manuel, thanks for bringing this up!  To tempted flag-raisers: although this looks very much like a bug, IMO it's not off-topic, because it can be sidestepped with a setting in normal use.. it's a problem we can do something about.

In the image texture node that you have plugged into the Metaliic input of the Principled BSDF shader change the Color Space option from Linear to Non Color.

Edited after reading Nathen's comment below :

I'm pretty sure it didn't used to be like that. I'd love to investigate that file, it's hard to imagine that's not a bug.

I did a quick check and the change happened somewhere between Blender 3.3.1 and 3.4.1 .
Gif below is Blender 3.6.1 LTS :

Blender file with packed image texture: https://blend-exchange.com/b/j6Kvwmyo

Oh man, when did that happen?  I'm pretty sure it didn't used to be like that.  I'd love to investigate that file, it's hard to imagine that's not a bug.

You are correct. It seems to have changed somewhere between Blender 3.3.1 and 3.4.1.    I have added an example file to my answer above.

3fingered .. good spot. +  @Nathan looks like a report, once checked out.. doesn't it? Whichever one of you goes for it..

@RobinBetts Looks similar to https://projects.blender.org/blender/blender/issues/106381 even though it's not a TGA.  I reported there.  It's weird, other images are working.


text:
How do I model the express key of a wacom tablet?
I'm trying to recreate my wacom tablet in blender and I'm trying to model one of the express keys so that's flat against the actual tablet surface. It's basically just a button shape:

Q: How do I model this shape?

Could you share some more about what you already tried and where you are stuck?
Otherwise it's a bit difficult to help you

someone already helped me but basically I attempted to do what he did with he circle but every time I used s it would make a weird shape. I tried cylinder, square with bevels, and a sphere.

Add a Circle mesh and select half of the vertices.

Press Y to separate the selection, and move it away along whichever axis it faces.

Select all (A) and press F to fill the shape with an n-gon.

In Edge Select Mode (2), select the two longest edges, press W and select Subdivide.

Select the new edge and press ⎈ CtrlB (Bevel Tool). Scroll  MW up once or type 2 to get two segments.

Select everything and press E to extrude the shape.

Select the center edge and move it down.

Delete the faces on the bottom.
Finally, select all the sharp edges and bevel them to your liking.

I'd recommend shading smooth at this point. ;)

If that's incredibly useful, please consider to accept the answer: https://blender.stackexchange.com/help/someone-answers @jasmine

how? there’s no option for that

@jasmine Here's how.

@jasmine I'm curious, when you say "there's no option for that" - where are you looking exactly? Where are you expecting the option to be? It would be good to know as we can make suggestions for improvements to the UI on the Stack Exchange meta site: https://meta.stackexchange.com/

I think i found it, it’s the check mark no? does it only show up on photo answers cause i can’t do it for comments, i can only upvote them. also, why is there no option to reply to certain people? Does everyone who ever commented get notified if i post a comment to my post trying to answer someone?

@jasmine Yes, it's the "check mark". Yes, you can only "accept" answers (to your own question). Comments on an answer are just that... comments seeking clarification on points raised in the answer. By accepting an answer you are informing other readers that the solution works... it also "thanks" the user who answered and assigns some "rep" to the answerer and yourself for "accepting". You "reply" to users by using the @ symbol followed by the username (as used above) - this triggers a notification for the user. Although all comments under an answer notify the answerer.


text:
Boxcutter - Mesh error when rendering
I've made some simple cuts using boxcutter, but when I export as an OBJ and open up the mesh in octane, the mesh has some bizarre errors.
There are some triangular pieces of geometry jutting out where I beveled the cutter, and there is some remanence of another cutter, even though I applied all modifiers and made sure the changes were final and no longer live.

Any idea how to fix this, or do I just need to redo all the cuts and re-export?

I'm not certain this is your issue, but have you (1) merged any duplicate verts, (2) applied scale before finalizing .obj export, and (3) confirmed the face orientation for all faces?

Thanks @zippy I checked all of it and found the issue.  There was a cutter that somehow got hidden way down in the outliner and was showing up in Octane even thought all modifiers had been applied.  The hidden one needed to be deleted.  Thanks for the reply!


text:
How do I change background image's size in compositor?
How can I change background image's size in compositor?
The following screenshots are showing my node setup and the current size of the background image.

Problem A Problem B Problem C Problem D

Hi and welcome. Please let us know if the linked q/a does not solve your issue and explain why in detail by editing your question, thanks. Also, I'd recommend take the [tour] to learn about how this site works.


text:
Export multiple objects to individual glTF files?
I'm looking for a tool to export 40.000 objects into the individual glTF files. Sorry, I don't have any basic Python knowledge so please allow me to ask for help. I found a similar add-on on this site, which does the job for OBJ files - would it be possible to make the same for glTF?
Thanks!

Hi and welcome! Bare minimum is to show some effort, please read: https://blender.stackexchange.com/help/how-to-ask Also please take the [tour] to learn about how this site works. Thanks.

Add-on based on the answer of Export multiple objects to .obj, adapted to export all selected objects to individual .glb/.gltf files.

batch_gltf.py
# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>

# Based on: https://blender.stackexchange.com/a/31852/

bl_info = {
    "name": "Batch Export GLTF",
    "author": "brockmann",
    "version": (0, 1),
    "blender": (2, 91, 0),
    "location": "File > Import-Export",
    "description": "Batch Export GLTF files",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Import-Export"}

import bpy
import os

from bpy_extras.io_utils import ExportHelper

from bpy.props import (BoolProperty,
                       IntProperty,
                       FloatProperty,
                       StringProperty,
                       EnumProperty,
                       CollectionProperty
                       )

class ExportMultiGLTF(bpy.types.Operator, ExportHelper):
    """Batch export objects as gltf files"""
    bl_idname = "export_scene.batch_gltf"
    bl_label = "Batch export GLTF"
    bl_options = {'PRESET', 'UNDO'}

    # ExportHelper mixin class uses this
    filename_ext = ""

    filter_glob: StringProperty(
            default='*.glb;*.gltf',
            options={'HIDDEN'}
    )

    # List of operator properties, the attributes will be assigned
    # to the class instance from the operator setting before calling.
    batch_export_format: EnumProperty(
        name='Format',
        items=(('GLB', 'glTF Binary (.glb)',
                'Exports a single file, with all data packed in binary form. '
                'Most efficient and portable, but more difficult to edit later'),
               ('GLTF_EMBEDDED', 'glTF Embedded (.gltf)',
                'Exports a single file, with all data packed in JSON. '
                'Less efficient than binary, but easier to edit later'),
               ('GLTF_SEPARATE', 'glTF Separate (.gltf + .bin + textures)',
                'Exports multiple files, with separate JSON, binary and texture data. '
                'Easiest to edit later')),
        description=(
            'Output format and embedding options. Binary is most efficient, '
            'but JSON (embedded or separate) may be easier to edit later'
        ),
        default='GLB'
    )

    batch_export_copyright: StringProperty(
        name='Copyright',
        description='Legal rights and conditions for the model',
        default=''
    )

    batch_export_selection: BoolProperty(
            name="Selection Only",
            description="Export selected objects only",
            default=True,
            )

    batch_export_image_format: EnumProperty(
        name='Images',
        items=(('AUTO', 'Automatic',
                'Save PNGs as PNGs and JPEGs as JPEGs.\n'
                'If neither one, use PNG'),
                ('JPEG', 'JPEG Format (.jpg)',
                'Save images as JPEGs. (Images that need alpha are saved as PNGs though.)\n'
                'Be aware of a possible loss in quality'),
               ),
        description=(
            'Output format for images. PNG is lossless and generally preferred, but JPEG might be preferable for web '
            'applications due to the smaller file size'
        ),
        default='AUTO'
    )

    batch_export_levels: IntProperty(
        name='Collection Levels',
        description='Set the levels of collections',
        default=2
    )

    batch_export_materials: EnumProperty(
        name='Materials',
        items=(('EXPORT', 'Export',
        'Export all materials used by included objects'),
        ('PLACEHOLDER', 'Placeholder',
        'Do not export materials, but write multiple primitive groups per mesh, keeping material slot information'),
        ('NONE', 'No export',
        'Do not export materials, and combine mesh primitive groups, losing material slot information')),
        description='Export materials ',
        default='EXPORT'
    )

    batch_export_colors: BoolProperty(
        name='Export Vertex Colors',
        description='Export vertex colors with meshes',
        default=True
    )

    batch_export_cameras: BoolProperty(
        name='Export Cameras',
        description='Export cameras',
        default=False
    )

    batch_export_extras: BoolProperty(
        name='Export Custom Properties',
        description='Export custom properties as glTF extras',
        default=False
    )

    batch_export_apply: BoolProperty(
        name='Export Apply Modifiers',
        description='Apply modifiers (excluding Armatures) to mesh objects -'
                    'WARNING: prevents exporting shape keys',
        default=False
    )

    batch_export_yup: BoolProperty(
        name='+Y Up',
        description='Export using glTF convention, +Y up',
        default=True
    )

    def execute(self, context):

        # get the folder
        folder_path = os.path.dirname(self.filepath)

        # get objects selected in the viewport
        viewport_selection = context.selected_objects

        # get export objects
        obj_export_list = viewport_selection
        if self.batch_export_selection == False:
            obj_export_list = [i for i in context.scene.objects]

        # deselect all objects
        bpy.ops.object.select_all(action='DESELECT')

        for item in obj_export_list:
            item.select_set(True)
            #if item.type == 'MESH':
            file_path = os.path.join(folder_path, "{}.{}".format(item.name, self.batch_export_format))

            bpy.ops.export_scene.gltf(
                filepath = file_path,
                export_selected = self.batch_export_selection,
                export_format = self.batch_export_format,
                export_copyright = self.batch_export_copyright,
                export_image_format = self.batch_export_image_format,
                export_materials = self.batch_export_materials,
                export_colors = self.batch_export_colors,
                export_cameras = self.batch_export_cameras,
                export_extras = self.batch_export_extras,
                export_yup = self.batch_export_yup,
                export_apply = self.batch_export_apply
            )

            item.select_set(False)

        # restore viewport selection
        for ob in viewport_selection:
            ob.select_set(True)

        return {'FINISHED'}

# Only needed if you want to add into a dynamic menu
def menu_func_import(self, context):
    self.layout.operator(ExportMultiGLTF.bl_idname, text="Batch Export glTF 2.0 (.glb/.gltf)")

def register():
    bpy.utils.register_class(ExportMultiGLTF)
    bpy.types.TOPBAR_MT_file_export.append(menu_func_import)

def unregister():
    bpy.utils.unregister_class(ExportMultiGLTF)
    bpy.types.TOPBAR_MT_file_export.remove(menu_func_import)

if __name__ == "__main__":
    register()

    # test call
    #bpy.ops.export_scene.multiple_objs('INVOKE_DEFAULT')

I added all relevant arguments of the export_scene.gltf() operator (line 179), you can change them or add new properties to the operator, wasn't sure.

For versions pre 2.91, replace the batch_export_materials property (line 117) using:
    batch_export_materials: BoolProperty(
            name='Export Materials',
            description='Export materials',
            default=True
    )

Related: Batch exporting scene collections or selected objects using glTF-Blender-IO


text:
How to split a certain area using python?
My screen has different areas: one 3D View and two Image Editors.
I would like to split one of the Image Editors but when I call the bpy.ops.screen.area_split() operator, it's always going to split the 3D View for whatever reason.
Does anyone know how I can split a certain area?

Related https://blender.stackexchange.com/questions/44427/splitting-of-screen-areas-and-retrieving-the-active-area-with-python   https://blender.stackexchange.com/questions/56911/how-to-open-a-new-editor-with-python

Iterate through all visible areas and override the context when calling area_split() operator.
Blender 3.2+
import bpy
from bpy import context

for area in context.screen.areas:
    if area.type == 'IMAGE_EDITOR': # 'VIEW_3D', 'CONSOLE', 'INFO' etc.
        with context.temp_override(area=area):
            bpy.ops.screen.area_split(direction='VERTICAL', factor=0.3)
        break

Blender 2.8+
import bpy

for area in bpy.context.screen.areas:
    if area.type == 'IMAGE_EDITOR': # 'VIEW_3D', 'CONSOLE', 'INFO' etc.
        override = bpy.context.copy()
        override['area'] = area
        bpy.ops.screen.area_split(override, direction='VERTICAL', factor=0.3)
        break

Was off searchin' for a particular answer on this, didn't see yours.  Closed and Re-opened.


text:
How to select and automatically assign a material item of a custom UIlist?
I'm really struggling finding info or anything about this.
I've made a an UI list with an imported list of material and displayed on the 3d view ui panel. So far a button 'set material' is changing the material on active object and it works fine.
But I would like to remove this button and directly change the material when I press on an item in the list.

Is your code copied from: https://blender.stackexchange.com/questions/30444/create-an-interface-which-is-similar-to-the-material-list-box/30446#30446 ?

Yes it is, it matched perfectly my needs at a certain point. The mat list is imported from a server (that's why the load Material list is unable).

I got PTSD from when I tried to work with UIlists previously but as i recall, you can link the active index to an IntProperty and use the update callback to know when an element is clicked

@Gorgious worked perfectly ! Thank you


text:
MixRGB Node - RGB vs HSV
While watching this tutorial, the author mentions the difference between HSV and RGB at timestamp 4:09. The thing is, when he adjusts the value slider to 0.5, the RGB values change to 0.214. When i tried this on my own, the value and the RGB is still the same. Why is this? For instance if I set the value to 0.5, RGB is also 0.5.

That video is using Blender 2.83. However, since then, Blender changed the HSV sliders from "color picking space" to "scene linear space".
See https://developer.blender.org/rBf193b1afb313bcb937a396f09da2b9903a0d2fc3.


text:
How can i connect those two points?
The following code is a copy from Add a simple vertex via python:
import bpy

def point_cloud(ob_name, coords, edges=[], faces=[]):
    """Create point cloud object based on given coordinates and name.

    Keyword arguments:
    ob_name -- new object name
    coords -- float triplets eg: [(-1.0, 1.0, 0.0), (-1.0, -1.0, 0.0)]
    """

    # Create new mesh and a new object
    me = bpy.data.meshes.new(ob_name + "Mesh")
    ob = bpy.data.objects.new(ob_name, me)

    # Make a mesh from a list of vertices/edges/faces
    me.from_pydata(coords, edges, faces)

    # Display name and update the mesh
    ob.show_name = True
    me.update()
    return ob

# Create the object
pc = point_cloud(".", [(0.0, 0.0, 0.0),(0.1,0.1,0.1)])

# Link object to the active collection
bpy.context.collection.objects.link(pc)

pass edges=((0, 1)) to create an edge from vert 0 to vert 1  Could you please post a link to  script source  if you sill have it.

My question:
In Input textbox, the user will be putting a configuration which will look something like this .
2-(90),5-(0),4-(-90).
This above configuration means :
Create a Line of
2 units in 90 degrees, 5 units in 0 degrees direction, and lastly, 4 units in -90 degrees.
As a submit button is pressed your script should create lines in z-plane as shown.
The top view will look something like this
https://i.imgur.com/0GETSLY.jpg

Coincidentally answered that yesterday

There are many code which is the correct code of the question can you share the correct code?


text:
How to fix potential lags while sculpting?
How does one fix sculpting lags in blender? I finally found the main culprit to why even super low poly count objects lag while sculpting.

THE MAIN CULPRITE IS "DISPLAY IN VIEWPORT" found under Outliner>Toggles.
Hiding objects that aren't being used is useless performance wise. So instead of just hiding objects not in use also disable display in viewport for every object. The best hardware in the world won't make sculpting smooth if you don't do this and have allot of other objects with high poly count in the .blend file.
Other small performance boosts:

Disable Cavity/ Matcap
Turn off wireframe
Turn off backface culling
Don't constantly use the silhouette trick where one has one window in viewport shading and only has environment pass enabled
reduce max amount of undo steps

How to get the biggest noticeable difference with the least spent money:

Ram is super cheap and changes allot - 16-32 RAM
Then CPU
And GPU doesn't help much it's main purpose is for rendering and doesn't have much influence in solid view

I feel so relived, this has been driving me crazy


text:
Blender 4.0 geo nodes: Bezier curve with 5 vertices subdivide only top 2 and bottom 2
How can I make in blender geo nodes the bezier curve only subdivide in between the top vertices and the bottom ones, while the one vertex in the middle is unsubdivided?
Appreciate any reply

May I suggest to remove unrelated tags ? And perhaps add [bezier-curves] ?

(Using Blender 3.6.8)
With Trim Curve nodes, the Bezier curve is split in 3 splines using the Factor parameter to define the endpoint positions.
Start: (see top branch of the following graph) The position of the second control point (i.e. with Index equal to 1) is recovered with a Sample Index node set in Point domain. Then the spline made of the first and second control points is subdivided once.
End: (see bottom branch of the following graph) The index of the before last control point is computed from the Point Count returned by a Domain Size node set in Curve domain, by subtracting 2 (because Index starts at 0). Once its position is recovered, the spline made of the before last control point and of the last control point is subdivided.
In between both: (see central branch of the following graph) The spline made of all control points between the second one and the before last one (included) is unmodified.

Resources:

Thank you for your reply. Is there a method to procedurally adjust the vertex concentration along the bezier curve when extruding bezier vertices, allowing for a repetitive pattern to be visible on the curve? Additionally, is it possible to scale and shape the cubes using the point on instance node?

About the first question on extruding Bezier vertices, I would recommend to post it as an other question, as it is quite complex because a curve made by GN can not be edited as a curve afterwards. Add explicit pictures of what you would like.

About the second question, could you detail what you mean by "scaling and shaping" the cubes ? As instances, these can be rotated and scaled, but not reshaped individually. Perhaps an other post will be more suited again.


text:
Fluids: stuck inside obstacle
Okay, I have a fluid stuck inside one of my obstacles. I made sure to get the inflow outside of said obstacle so it doesn't collide with it. I intended for this fluid to flow into a small pool and then overflow into a larger one.
Here's the file:
https://drive.google.com/file/d/0B1dIaL3qkRdQYjhYYklFNzZWSWc/view?usp=sharing
I'd give a picture, but I have lunch right now.
Now I ended up with this:
http://prntscr.com/9p5fx2

Here are the things you need to change to make it work.

Your fluid domain needs to be a box.
Your spherical inflow object vectors are all set to zero. Give it some value.

NOTE With vector of Zero on (X,Y,Z) your inflow will be manifested as slow drips of water.
Here are my tests.

Download here for your reference.

I did those two things, and got this: http://prntscr.com/9p5fx2

Okay, so I was able to fix that leaking issue: the domain needs to enclose every single obstacle in the simulation.
However, there's still the issue of how the fluid interacts with the obstacles. Mainly the spring and how it's interacting with the fluid. Firstly, the fluid is still going inside the obstacle. It's not leaking out or getting stuck, but it's still getting into the fluid. Here's an image on this:
https://drive.google.com/file/d/0B1dIaL3qkRdQTEtCVDRPQW1FMDQ/view?usp=sharing

https://drive.google.com/file/d/0B1dIaL3qkRdQX3R0VHRFM2NNY28/view?usp=sharing
There's also this issue. The fluid isn't really landing on the ground, or ends up leaking through it, as seen in this image:
https://drive.google.com/file/d/0B1dIaL3qkRdQMGcxTk1SQmxLejg/view?usp=sharing

I might be compel to think that the scale of object in your scene seems to be giantic. The rock that spills water is approximately 16 meters tall in blender units. Scale is a important factor when dealing with simulation.

.blend file is broken, after multiple saves. I think it's corrupted now.
https://drive.google.com/file/d/0B1dIaL3qkRdQM2U5a09Yd0pUQXM/view?usp=sharing

Or, it could just be blender itself, since I downloaded your file, and wasn't able to bake it either.

My blender version is 2.75 , if it helps at all.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
I can't make my material transparent in Blender 2.80
I can't seem to have my material turn transparent in blender 2.80. Heres some screenshots, is there something I'm missing?
This is how it looks in EEVEE:

Here is my node setup:

using Eevee you have to activate it per material in the material menue. See here: https://blender.stackexchange.com/questions/134368/opacity-of-an-object-in-2-8

Thank you for solving It!

If you want to make the object transparent, their are 2 ways to do that:

Use transparent material (as you have already used), Add it to a mix shader whith the respective shader you want it to mix with and change the blend mode for the object to "Alpha blend".

Now, you use this method when you want to create an object with just transparency, that means without any reflection (that doesn't quite exists in real world). Every transparent material has refraction and if you want your material reflect like glass you can use the second method.

Using a glass shader. It won't directly reflect the changes right away, you need to enable "Screen space Refraction" for both the scene and the material you. Then you need to change the refractive index of the material to the one you wish for, or just keep it anything else than 0.

Scene settings to enable refraction

Thank you for the help!

Happy to help! :)


text:
How to check a json file dynamically with blender?
I have a json file that is dynamically generated on a server. I'm currently using a python program to copy it locally.
I have a script that can check the json file from blender, and change my object rotation, but I can't seem to make it work periodically (like, I'd like the script to run every 0.2 sec).
import json
import bpy
import time

def doit():
    with open('/somepath/blendjson.json') as data_file:
        data = json.load(data_file)

    coordx = float(data['coordx'])/5
    coordy = float(data['coordy'])/5

    bpy.ops.transform.rotate(value=coordx, axis=(-1, -0, -0), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

    bpy.ops.transform.rotate(value=coordy, axis=(-0, -1, -0), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

while True:
    doit()
    time.sleep(0.2)

This script doesn't do anything in blender. When I kill it in the terminal, it throws an empty error, with nothing following it :
"Error: Python script fail, look in the console for now..."
The issue here seems to be that time.sleep blocks the script. I can only see the results when I kill it.
I'm looking for an alternative to time.sleep that does not stop the script. I want to run the def every 200 ms, and see the result in real time.

The time.sleep(0.2) works with a simple print("test") instruction inside of the def.

So, did you look in the console?

As I said, I looked into the terminal, where the error should appear, and it only told me to look in the console. I generally look there to look for the errors I get.

If you have more information to add, use the [edit] link below your question.

There are some limitations doing this (about thread or timer), but you can use the approaches described in this answer https://blender.stackexchange.com/questions/64524/blender-how-to-periodically-reload-file-python

It works nicely ! Thank you  ! Now I just need to optimize the other parts. Digging into bluetooth communications instead of using an online server...

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
The animation on the child is not creating keyframes
Basically, my question is the title. I have a "battle" tank, and am using the "Blender Game" engine to make a simple animation by recording the movements in-game.
When I move it with WASD, it creates keyframes, but the movement of the turret (with the mouse) is not creating keyframes. The turret is parented to the hull of the tank, with contains the logic bricks for WASD. I record the animation, moving the hull and the turret, but only the movement of the hull creates keyframes:

I tried unparenting the turret and simply copying the logic bricks to it so that it moves the same way as the hull, but the turret flies away or disappears when I start the game. I believe this might be some issue with the bounding box, which I'm not sure how to fix as I did not create the tank model myself.
I feel like there is a simple solution to this, but if you anyone needs more information or would like the .blend file itself, I'd be glad to share those.


text:
How to make all objects rotate in the same way
In other words how do i prevent this from happening:

Thanks

Looks like your pivot point is set to "Individual Origins". Switch it to "Median Point" if you want your objects to rotate around the selection center (as by default). Or you may also use any other pivot, like 3D cursor, etc.


text:
Are Vertex Color layers limited to 8?
Why is there a limit for vertex-colour layers? Is this a bug or
is there a reason, why I cant add more than 8 vertex-color layers?
I will make a bug-report if it is a bug - but I'm not sure for now.
To see what I'm talking about: Open blender, select the cube then in Properties > Data > Vertex Colors Panel and add as many layers as possible. It will stop at eight.

Certain limitations are built into the software at the time it is compiled (built) and the number of Vertex Color slots and the number of UV slots (8 in each case) are two such limitations. The software has to be designed with certain assumptions to allow the various data structures to be handled and stored efficiently. At some point in the past it was deemed sufficient to only support 8.
I believe it has been suggested that a future development will increase this limitation - although I can't find reference to it at the moment. For now, I'm afraid 8 is the limit.


text:
Unwanted black frames around fog material
So I was following this Tutorial; https://www.youtube.com/watch?v=72LPW4S8bns&t=1263s
then I was creating the fogs but suddenly the fog boxes that are further from camera started getting black corners.
Im posting the nodes, please take a look

The problem and the solution to it is mentioned in the video you are linking to (appr. 20:10).
You have to increase the max bounces for Transparency under Render Properties / Light Paths / Max Bounces until the "black boxes" doesn't show up anymore.

Yes you are right Im sorry I was skipping the video to get it done faster, thanks :)


text:
Local axis of imported objects
I'm fairly new to Blender, but have come from a 3DS max and Inventor background. I have imported a model done in Inventor, in OBJ format. This is quite a large model of a steel structure with approx 500 objects. On import all of the objects have their origin at the world origin (0,0,0). These objects local axis are also aligned with the world axis and not with the objects.
I can set the origin of these objects to a new location but aligning the local axis is tricky. I can create a new transform based on a face but this will mean creating lots of custom transform orientations for many parts. Is there a way of manually adjusting the local axis to align with these parts?
Below is a screenshot of part of the project. The image shows 3 tubes all at different angles. The local axis of the closest tube is not ata ll aligned with the tube part.
I would like the z-axis to align with the axis of the tube.
At the moment my work around has been to select the end face of the tubes and align the view to that face. Then add an empty aligned to view. If I parent the tube to the empty I now have the desired local axis that I can scale. It is taking a while to do these steps on many parts.

Thanks in advance
Nigel

How do you define an axis that is 'aligned" with the objects? Is there a simple unambiguous rule, or is it human judgement? If you can define some simple rules it may be possible to script this, otherwise not really.

Maybe what I should have said was have an axis aligned with a normal of a face. I have found a work around which I have outlined below.

At the time of import: use the FBX options, and scale to 0.005 or 0.05
Else: Make an empty, import your 500 objects. When they come to scene make sure you are looking at your empty. then "A" (to select all), then "A" (or ALT+A if 2.8) and every object is now selected. LASTLY: SELECT YOUR EMPTY. Then hit CTRL+P (Parent objects), KEEP CURRENT TRANSFORMS.
Everything will be child of the empty object you made. Now, press "N" to bring the numeric panel on your 3D viewport. And try scale 0.05 on all X, Y, Z
See if that works.
If you find this is the answer, thank you for your consideration to vote me as the answer by clicking to the left :the icon with a check mark and upvote this answer.
BFCT_Schiller

<kbd>N</kbd>  for keyboard markdown.

thanks! so G rateful


text:
Custom made menu hotkey problem, blender doesn't find it unless I run it form the text editor
I am new to scripting in blender, kinda new to python as well.
I followed a tutorial on how to make a custom menu in python, and then add it as an addon in blender. Now I installed it from file and it worked, I enabled it and assigned an hotkey, but unless I run it from the text editor I get this error:
Report: Error
Menu "gino" not found.
(gino is the bl_idname)

if I run the script from the text editor once, the hotkey start working and I don't receive any errors.
How do I fix this so that when I start Blender my addon work with that hotkey?
This is the code:
bl_info = {"name" : "GinoMenu","category" : "3D View","author" : "Edo"}

import bpy

class customMenu(bpy.types.Menu):
    bl_label = "G I N O"
    bl_idname = "gino"

    def draw(self, context):
        layout = self.layout
        #pie = layout.menu_pie()

        layout.operator("mesh.primitive_cube_add")
        layout.operator("mesh.primitive_cone_add")
        layout.operator("mesh.primitive_circle_add")

        return{'None'}

def register():
    bpy.utils.register_class(customMenu)
    #bpy.ops.wm.call_menu(name = customMenu.bl_idname)

def unregister():
    bpy.utils.unregister_class(customMenu)

if __name__ == "__main__":
    register()

Please see the bpy.types.Menu docs re naming convention for menus.  Something like bl_idname = "MESH_MT_gino"  Would also call the class the same class MESH_MT_gino(bpy.types.Menu):

@batFINGER thank you for your comment, will do but that shouldn't be what is causing the error, correct? Be patient if it's a lame question, I don't know the subject very well, yet.

Could be what is causing the error.  Also recommend putting version into info dictionary.  Are there any messages printed in system console when blender is starting?

@batFINGER thank you for your time, I tried renaming as you suggested and uninstalling and reinstalling the addon but I still get the same error:
Report: Error
Menu: "MESH_MT_gino" not found

Ok, you mention the addon is enabled, can you add a screenshot of the keymap?   I have addons that register menus, eg "TEXT_MT_nvim_buffers".  I can see it is registered in the python console by auto completing to see that  bpy.types.TEXT_MT_nvim_buffers (my menu) is registered.  Can call it from the console or from a keymap with bpy.ops.wm.call_menu("TEXT_MT_nvim_buffers") as expected.  Just looked again and wouldn't return anything from a menu.  (which is same as return None)

@batFINGER sorry for the delay, I missed part of your previous message before, seems it was a matter of adding blender version into the dictionary to make it work, thanx a lot for your help!

Yep that explains it. Could you please put together an answer.  2.8 does some checking of version number when registering addons (to give the might not work warning if version < 2.8)  IIRC it writes some error or warning to console re no version number.

for anyone facing the same problem in the future here is the solution, thanx again to  batFINGER for helping me find it.
you need to make sure that you put your blender version in the script's dictionary, in my example:
bl_info = {
    "name" : "customMenu",
    "category" : "3D View",
    "author" : "Edo",
    "blender" : (2,80,0)
}


text:
Sending data to Blender Script and displaying them
I want to send the changing outputs of a python script to Blender and display the results (moving Handjoints). Via Socket i achieved to send the data to blender, but i want to send it continuously. However Blender freezes, because of the infinite loop.
How can i bypass the infinite loop and send the data continuously?
Server.py
from socket import *
from time import ctime
from threading import Thread
import random
import pickle

class ClientHandler(Thread):
   """Handles a client request."""
   def __init__(self, client):
       Thread.__init__(self)
       self._client = client

   def run(self):

       rand = random.uniform(1.0,5.0)
       d = {1: rand, 2: 3.0}
       msg = pickle.dumps(d)

       self._client.send(msg)
       self._client.close()

HOST = "localhost"
PORT = 15200 # Port number was changed here
BUFSIZE = 1024
ADDRESS = ('', PORT)

server = socket(AF_INET, SOCK_STREAM)
server.bind(ADDRESS)
server.listen(5)

# The server now just waits for connections from clients
# and hands sockets off to client handlers
while True:
   print('Waiting for connection')
   client, address = server.accept()
   print('...connected from:', address)
   handler = ClientHandler(client)
   handler.start()

Client.py
import bpy
import time
import socket
import pickle

class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    timer = None

    def modal(self, context, event):
        print("HELP")
        if event.type == "TIMER":
            msg = self.s.recv(1024)
            try:
                d = pickle.loads(msg)
                print(d)
            except EOFError:
                print("Raising Error")
            #print(pickle.loads(msg))

        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        self.timer = context.window_manager.event_timer_add(0.1, window=context.window)
        self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.s.connect(('localhost', 15200))
        context.window_manager.modal_handler_add(self)
        print("INVOKE")
        return {'RUNNING_MODAL'}

if __name__ == "__main__":
    bpy.utils.register_class(ModalOperator)
    bpy.ops.object.modal_operator('INVOKE_DEFAULT')

have you tried using drivers or modal operators?

updated the client.py with your suggestion, but i'm running into an EOFError issue of pickle.

Related https://blender.stackexchange.com/a/57087/15543

tried both solutions, but i'm getting the same problem as i mentioned before with pickle. didn't think passing data through is such a big act ^^


text:
How to access texture aspect ratio info (Cycles nodes)
I'm attempting to create a node tree that will set some scale values based on the aspect ratio of an image texture. I've been having no luck finding any solutions for accessioning this type of image texture info inside of a node tree.
The larger goal here is to implement this spot light projector effect with the correct aspect for any texture I assign without needing to manually set the scale values. Spot light with square shape
Thanks in advance.

I don't think image textures are aware of pixel aspect ratio, they just expect square pixels as far as I know. If they are then I know of no way to access that information from within a Cycles node tree, at least not without some scripting or python nodes.

Thanks, I'm pretty new to shaders and didn't know that was the case. It's looking like I may be able to achieve my goal via scripting.


text:
Shifting local rotation axis of objects
new to blender, but eager to learn, and spending lots of time with blender now.
I am trying to make a simple solar animation in Blender 2.79, Cycles engine.
The earth spins around the sun's (scene's) Z axix, but earth also has a constant tilt of 23.4 degrees to the sun. I need to keep this earth tilt constant and make the earth spin around it's own Z axis.
I cannot figure out how shift the earth-mesh-objects coordinates.
Even if I set the transformation orientation to Local, the earth still spins around the global scene's Z axis when I try to animate or rotate the Z axis of the earth.
I have googled and searched but cannot find an answer.
BTW! I don't want to change the angle of the sun to the earth to achieve the same effect. I also suppose I could manually apply rotations to all axis of the earth to simulate this, but this complicates things as I also have other objects I need to apply this to.
Any tips on how to separate the earths axis from the scene and being able to apply separate/local rotations? As you see in the attached picture the sun and the earth mesh has different axis, but still, when trying to animate the earth it rotates around the scene/suns axis and shifts the poles of the earth around.

Related Suggest keeping planet origins at centre of mass, and using a path as an orbit. Orbit

Thanks, getting the earth to follow a circular path around the sun using the world/scenes coordinates, I think I will manage. The challenge for me is to also get the earth to spin, around its own custom Z axis angle of 23.4 degrees.

I thought I solved this. Using custom transformation from another object, eg. the axis I have through the sphere. The only thing is the earth mesh still seem to be calculating the coordinates from the global scene, and aligning to the custom transformation object. It would be nice If the X and Y axis would be kept at Zero (0) and only the Y axis changing values when I rotate the Y axis.
If I lock the X and Y axis, and now try to drag or change only the Z axis of the sphere, or to animiate it, it still spins around the global axis.
SOLUTION: Found out I had to change the Rotation from XYZ Euler to ZXY Euler, now rotating the Z axis gives me what I wanted.


text:
How do I rig Walschaerts valve gear in Blender?
I'm trying to rig a Walschaerts valve gear, which looks like this:

I've got some of it working, but I can't figure out how to get the combination lever (the mostly vertical bar between the wheels and pistons) to be influenced from both sides while attached to the valve stem (the upper piston) which it rotates about. The point where the valve stem attaches to the combination lever must not move vertically on the z-axis, but does need to move horizontally along the y-axis, which is what controls the valve stem.

I've got one IK constraint on the large yellow bone + the two bones guiding the lower piston. I have another IK constraint on the small yellow bone all the way through the two bones controlling the upper piston. I just don't know how to influence that from the top as well.
I've tried adding another IK constraint to the bone beneath the highlighted radius rod, but I can't get it to work. I basically have one rod, and each end needs to be acted on by a different IK constraint.
In case it is of use, here is my blend:

Hi, pasteall will remove your file after a few months, it is preferred to use Blend-Exchange for uploading .blends to the site, as files are not removed and questions/ answers don't eventually  lose relevant information for future users.

I believe you should simplify the question since the circumstance is very complex and difficult to understand. By the way, have you tried drivers?

I am confused because scrubbing your animation seems to show that the point where valve stem bone attaches to the combination lever low bone is not moving in the z direction.  I suspect I don't understand your question.

I think the problem is that you have the valve stem and crosshead rigged to move together.  In an actual valve, the motion is more complex
I'm not good at drivers, but what I think you need to do is match the actual cycle more closely.
Using the animation from wiki starting with the valve stem all the way to the right end of its cylinder, the piston end of the cross head in the middle of its cylinder

Steam enters, pushing the piston to the left end of its cylinder
As the piston approaches the end of the cylinder the various mechanical linkages pull the valve stem to the left.
Once the valve stem is all the way to the right, the direction of steam reverses. This reverses the direction of the piston.
The piston moves all the way to the right
Mechanical linkages pull the valve stem to the left

end of cycle.
A driver that causes the cylinder head to move as if it were driven by steam and a set of bones that match the actual mechanical linkages, down to parenting, should cause everything to behave properly.

I reversed the IK on the lower linkage near the piston, created the bones and an IK system for the switch (plane.001) at the top of the system, You'll notice that I doubled some of the bones. In order to deal with the IK being calculated last in the modifier stack I had to parent the IK bone to a double of the actual target with a copy transforms modifier.
I know that I'm explaining this horribly, so here's the blend file.

Is this what you intended?

Have you looked at Damped Track or TrackTo? I looked at the blend file. I'm going to try to do something with it. It looks like the armature is parented incorrectly. Have you considered having two different armatures? I remember when I animated a wishbone suspension system I had a lot of parts that moved together but separately. I used 3 armatures per system. One to control the strut, one for the upper control arm, and one for the lower control arm. I think your upper, what I'm assuming is the exhaust and intake, piston needs to have a separate armature but link them with tracks. If I have time I'll try to edit this to make it work. This does look like a complicated setup. But one thing to note in the future is power flow. Just add in bones to act as force transmitters. Then you can have one driver "pushing" the whole thing.


text:
How to pick which UV map will be exported with model?
Short explanation of the issue:

I've got 2 UV Maps, one for texturing and the other for the baking, optimised for the engine.
I have successfully baked the textures of my model using both UV Maps.
Now I want to export the model with the UV Map that matches the baked texture map but no matter what I do, the wrong map gets exported.
The baked texture doesn't show up on the model correctly because it's using the UV Map used for texturing and not the one for baking.

What I've tried so far:

Setting the one I want to export to Visible in Object Data Properties.
Changing the names so that the one I want to export is called "UVMap".
Deleting the UV map used to texturing.

And here's the thing, solution 3. works but I don't want to be deleting all those maps on my model, taking it into the engine to test and then not be able to come back to blender and fix any mistakes.
Is there anyone who can advise/assist on this issue? I'm sorry if this is an obvious one, I'm a relatively new blender user moving from Maya.
Thank you!

Why don't you simply duplicate your object, duplicate the material, and remove the UV map in the duplicated version?

@moonboots Thanks for the reply! Technically that works but I am hoping there's a more elegant solution that doesn't involve deleting things :) I will do this for now, thanks!

I guess in your case you completely depend on how the game engine works so you have no other choice


text:
How to bake metallic materials into diffuse map?
Hi there :) I'm curious why baking using the Combined Bake Type doesn't bake the metallic values next to baking diffuse and shadows/lights.
Are there any special settings that I missed or is there a completely different way to do this?
Note: I'm not trying to bake the Metallic map, I already did and will use that together with the Combined map if I don't find a way to only use one map but I can't imagine that this would be impossible to do in blender.
Thanks!

The general thing in 3D that makes a metal metallic, is that it has a black diffuse and a tinted glossy component (along with an altered Fresnel response, but that's tunable.)  This corresponds to the physical reality of an ideal metal: photons do not pass through its surface to bounce around and reflect diffusely from deep within; they only ever reflect off of its surface, or they are absorbed.
Because of this, a metallic object has no diffuse component, only a glossy component.  Any diffuse bake of a fully metallic material will give you black, because a metal's diffuse component is black.  If you have a metal mix, you'll just get a darker version of your base color, because all that an interpolated metalness is doing is interpolating between a full metal and a full non-metal.
In general, baking glossy components doesn't make a lot of sense, because they're view dependent-- unlike diffuse, they depend on where the camera is; they point at the reflection of the incoming vector over the surface normal.  So any real glossy bake might as well be a render instead of a bake: they're only ever going to be valid for a single camera position*.  Because metals are glossy and thus view dependent, no bake is going to capture their response.
Most engines are going to include a metallness-based material, in which case there's no need to bake metalness into diffuse-- you just bake it into metalness, by plugging your metalness value into emission and baking a new texture (from an emission bake rather than a diffuse bake, of course.)  Then you can use your metalness texture as your metalness in whatever engine you are using.
*There are times when it's useful to bake view-dependent effects into a fixed texture, but unfortunately, Blender doesn't do that, or rather, doesn't do it very well; as far as I can tell, it always use the surface normal as the sample->camera vector.  Maybe if Eevee baking is ever implemented, we'll see the potential for Blender to do some view-dependent baking.

I appreciate the time you took to reply and write everything out in detail!
It's a specific project I'm working on and I need the Metallic to be baked in regardless of the angle the model is being looked at like you mentioned at the end. I use a studio light setup for this (so that the reflections don't look odd) and I've used Octane in the past to achieve this so I was curious if Cycles had a similar option.
Thank you!

@tzarica If somebody needed a view-dependent bake, I'd recommend rendering it and then painting it onto the mesh (or possibly baking the render from projected uv to real uv.) It'd take at least two renders.  You could mix between the renders by the ratio of light from suns with the cameras' orientations.

I'm definitely playing around more with this. Thanks @Nathan!

There is no metallic pass to bake in the first place.
Metallic data in the Principled BSDF shader influences the material's Diffuse and Glossy passes. Metallic isn't a pass in rendering, it's a type of data processed by the Principled BSDF into the render.
Combined type baking calculates render passes, the components of the "final render result" in a way. If none are excluded, it's basically baking the final render result as is.
More info:

Render Baking — Blender Manual
Principled BSDF — Blender Manual
Passes — Blender Manual

Thank you for taking the time to reply to the question and add the links, appreciate it!
I'm aware that Metallic isn't a pass but under the bake options you can tick Glossy and I was wrongly assuming that that would bake the metallic values as well.
I'm trying to do what @Nathan suggested in his comment but looks like there's no option for that for now so I will be using a Metallic map like you're saying :)


text:
Add circles at boundary of cells in voronoi texture
I'm looking to achieve a similar effect to this -- where there are circles at the cell boundaries of a voronoi texture, though ideally the circles would not be evenly spaced and I would be able to adjust the size and number of circles.

I found this answer to a previous and somewhat similar question in which the answer indicated that there is not a simple solution as blender does not track these points. However, in my case, I am not looking to place the circles only at the triple-points, but instead along the entire boundary. My apologies if this question has the same answer as the previous question linked above, but it was unclear whether they meant that blender didn't track the triple points or whether they didn't track the boundary in general.
Below is my current node setup and resulting texture.

This is as far as I was able to do do it within the shader alone:


text:
Background can be seen through objects, Alpha Over doesn't work?
I made another post for this earlier but I didn't exactly explain it well enough. On the render, you can see the stars and such behind the planet, as if it's transparent. I tried using the Alpha Over node in Composition like I was told but it didn't work. I was re-directed to another post but
it wasn't really the same thing. My background is another layer and such, as shown in the bottom left. I can't get it to appear in the above so I can connect it to Alpha Over and it won't let me add one to its node editor.
The bottom right is the planets texture and the top is just more detail onto it

Here's the link to the file https://www.dropbox.com/s/m032wc3pg66a7wv/Game.blend?dl=0

@cegaton Sorry, I'm new to this forum. It said on the other post how I have to continue through chat as comments were getting too long and for some reason it it said I wasn't high enough? Also it said that the question was already answered so I was confused on whether I could still add to that post or not. Sorry about the screenshot, when I get ahold of a computer I'll post the file. Also, I'm using cycles render with "noise" as stars. The tutorial I was following did it

It says that it's read only and I need 20 reputation. In about 30 min,  I'll be able to fix the screen shots. Since I can only post 2 on here, I can instead post a link to an Imgur album of multiple images with better resolution

You just missed to check "transparent" in the render panel, under the film section.
Once you do that, your two renderlayers will have their own alpha channels and you will be able to composite them.
However, you'll notice that you no longer have the sky background. To bring it back you just need to turn the environment pass on in the planet render layer, and use it as background for your two plates.

I think I know what's going on, so I'm just gonna go ahead and take a stab at it... we'll see whether my risk pays off or not ;-)
I'm not convinced that you're seeing what you think you're seeing. I'll bet that you're using the Cycles renderer. Furthermore, I'll bet that the "stars" you're seeing "through" the moon is actually noise that is the result of too few samples.
To test this, replace your stars background with a checkerboard or some other non-spots background. I'll bet the checkerboard (or whatever) does not show through, and the "stars" are still there. This would indicate that it's not transparent, and the noise just happen to look like the stars you're using.
If this is true, the solution is to render more samples, or be more selective about which samples you're rendering (with branched path tracing). There are also other more specialized and more sophisticated noise reduction techniques that may be worth looking into.
I hope that helps!

The stars are noise I added using nodes. I've increased the samples, to the point of tripling it, yet it doesn't fix it.

well darn, I guess I'll have to guess again ;-)

If it helps, I used this tutorial for it https://youtu.be/9vbq6HOgA2w Sorry that I'm not much of a help, pretty much everything I've done so far is through a tutorial as I have no idea what I'm doing

Guess #2!!
Try reversing the inputs of your Alpha Over. It's possible that your stars are going on top of your moon, and the "black" is alpha.
If that's the case, it'd certainly look the way it does, but without being able to see your nodes (images are small), it's hard to tell for sure.

Sorry, I split it up into 3 albums, the first being of the nodes within Composition imgur.com/a/bHSkH This is the nodes for the planets texture imgur.com/5wo5xd8 and here's the background aka stars imgur.com/a/h4RAg It only let me put 2 images on here so I was pretty limited. But I'll try reversing the Alpha Overs and see what happens

Oh my... that's a really complex setup. For starters, only swap the slots on the VERY FIRST Alpha Over, the one that combines the two render layers. If that doesn't fix it, then it'll take some more intense digging.

It didn't change anything http://imgur.com/a/uIpyZ I got the file link here, that might be easier though I don't know if the planet texture will be missing in that or not. https://www.dropbox.com/s/m032wc3pg66a7wv/Game.blend?dl=0 Here's the texture I used just in case http://1.bp.blogspot.com/_9DvzmslTIME/TQrT5bEDbII/AAAAAAAAAi4/q0jL2oQ_4rk/s1600/planet_Trask1200.png

Fascinating....

What do you mean?

I mean that I'm flummoxed as to what the problem might be. Even if that wasn't the problem, swapping the inputs should have at least done something crazy like make one of them disappear. Just for giggles, you might set up two File Output nodes to save the two images you're compositing together. Take a real close look at them and see if maybe there's something that's transparent that shouldn't be.

Ok I'll try that. Also, somebody suggested using an environment socket on the render layers and connect it to the Alpha Over. That didn't work but I'm wondering if I even did it correctly. As the noise is under the world nodes, is there a way to connect it through composition? If I need to, I can replace the atmosphere render layer with something else. Also I forgot what I did but I I did something earlier that ended the entire render being completely white earlier. I'll see if I can retrace what I did

If the stars are ONLY in the World nodes, then the ONLY possibility is that your moon, or some part of that layer is transparent... I'll have to investigate later...

So I deleted the Texture Coordinate in my planet nodes and other than it turning grey, I noticed that it no longer had that transparency to it. So that kinda fixed the problem but then I no longer had the texture. http://imgur.com/a/OOpnY

Yeah, I'll bet you a whole lot of... something, that your texture is introducing some kind of transparency. I'll try to remember to take a look at your file this evening and see what I can find.

Thank you. I might be using the wrong socket (using generated) in the Texture Coordinate because I've tried using different textures but same problem. Maybe it's doing this because I'm using a texture in general but I don't see why

...this is going to take quite a bit of explaining. Let's move this to a BlenderArtists forum.

Here's the forum where we can discuss a bit more freely: http://blenderartists.org/forum/showthread.php?399159-Migrated-explanation-for-TitanJedi-from-Blender-SE&p=3051508#post3051508

I discovered that it is not caused by the background. Upon deleting the noise (stars) in background, the noise that appeared in the transparency of the planet remained so I've narrowed that out of it. I was thinking it could be something about texturing or perhaps lighting?

That's possible, but I'm pretty sure it's the compositing setup. Can you go to the forum post linked above and send me the image texture you're using for the moon?

Ok I did, It just says that I need a moderator to approve it.

Moderator approval to reply to the post?


text:
Compress vs Uncompress when managing blend files with GIT
As you all know, there is a compression option when saving blend files in Blender.
I tested to commit the changes to GIT with a blend file consisting of 50 torus with 3 subdivisions applied. I thought uncompressed files would be much more efficient when using GIT, but regardless of whether they were compressed or not, the growth rate of the git folder was similar.
I don't understand this result very well.
I want to hear your experiences. Do you want to compress blend files when using GIT? Or would you like to uncompress?

After reading @HikariTW's answer, I carried out a more precise test. As a result, I realized that I had been mistaken. GIT wasn't just picking and saving changes to the blend file, it was just storing copies of the blend file every time it made the version. Blend files are treated as binary files, so it's natural. However, because GIT compresses and stores copies of the blend file, the size did not double. Because I didn't know that GIT was compressing when I created the version, I was mistaken for GIT to pick up only the changes in the blend file and store them in the version.
As a result, I recommend using a compressed blend file as @HikariTW said. When you commit a uncompressed 100MB blend file, GIT compresses it, makes it 33MB, and adds it to the .git folder. But if you compress and store a 100MB uncompressed file in the blender, it becomes a 33MB blend file, which is committed by GIT to compress it one more time, make it 27MB, and add it to the .git folder, so you can keep the storage smaller.

What? You can use GIT on blend file? Is there a blend decoder version of GIT? How does GIT or that version control core know where is the difference? Take a step back, how did you except GIT will do for your blend file? Should it track change made in that file?

And what if you just use Blender build in my_donuts.blend.001 logging style save feature and ignore those file in your gitignore? Wouldn't that be more reliable without increasing the size of repo?

@HikariTW I tested using the source tree.
And the target I want to manage is a 3D animation project in which blend files, psd files, and sound files are organized in a folder tree.
Until now, I have manually copied and renamed the files to version control.
However, that method messed up the link relationship between the blend files and the file size became huge at a fast speed.
So I want to use GIT(Source Tree) for my project.

I still don't get it. Why you use GIT (that GIT) on a binary file like .blend file? There should be bunch of articles tell you Never commit binary data into GIT. with thousand of reason. Could you explain why you need a distributed version-control system with your project? If you want only back-up, using any cloud drive with auto-upload would be a better option

Or you can check out binary diff to make different only commit to GIT (still not a good idea). Since I don't think .blend file will be stable enough to make GIT repo small.

https://stackoverflow.com/questions/540535/managing-large-binary-files-with-git, https://superuser.com/questions/715690/can-i-use-git-to-version-control-psd-files-and-maya-projects

@HikariTW Oh, thank you. That sounds like a new view to me.
I guess I need to explore more of the methodology for backup and collaboration for 3D animation projects before looking at GIT.
If you have any keywords or links to search, please recommend them to me.

GIT is a version control system, Source Tree is a GUI interface using GIT. GIT is not the only version control system, GitHub is a website like dropbox with GIT control system. You can search binary file or project file with GIT keyword, there should be a lot of version control system based on GIT and make .blend file controllable without saving every single committed .blend file.

Possible dup of this post: https://blender.stackexchange.com/questions/108115/version-control-for-blend-files

Please do not add manual line breaks to the question body after each sentence, makes it hard to read on non-mobile devices, thanks.

Back to your title's question:

Compress vs Uncompress file into version control system?

Use compressed if the system can not create a differential
Most version control systems have their own compress algorithm when storing each file.
Using Blender's compression will only confuse the system on file content and unable to find a minimum diff between different versions of files which may lead to massive amount of savings in your repository.
While some systems using .gz or other common compression methods, .blend files are most likely treated as binary files unless there is a toolchain to let the system decode the meaning of Blender's files. So an uncompressed .blend  might be treated as a compressed one, then choose the smaller one since Blender's compression is specifically to it's own file type.


text:
Cycles special Water shader (Low Poly)
I made a low poly planet with mountains and water on it, and I am trying to achieve something like this :

(Of course without the rocks in the space and the nice background)
I tried several shader combinations (Refraction, glossy, glass, transparent, ...) but I can't get anywhere close to it :

I watched several tutorials and found only realistic water shaders that are using glass, and if I use glass or refraction shaders I get bad results in the middle of the planet. How can I achieve nice looking shaders like the first one, I would love to get some help or advices.
Here is my blend in case you want to see my materials :

Ground surface have to keep own relief under water surface;
In original picture probably presents some specific HDR environment map producing specific light, hard to achieve with common light sources.
I'm not shure you need decimate modifier (but this not really important).

Well. I tried to reproduce original picture (but without HDR environment). Afraid it will took much longer time to write what I've done than time I had spent doing this scene :)

Wow man, that's exactly what I needed :). I see that you can use the "Geometry" node with a "mix shader" to make this "atmosphere effect". The work you made is teaching me a lot about node combinations, thanks a lot, you did great shaders! :)

Atmosphere effect is fake as always, because real volume absorbtion/scattering eating too much cpu/gpu. I think in original it was painted in 2D. Most time you have to learn about "good fakes".

Yes faking is always nice to spare some cpu/gpu, I thought of doing it with a spot lamp poiting to a dark plane behind the planet or something like that, but your technique is really nice actually!Can I ask you how you learnt to make shaders in cycles? I mean what tool did you use (Video, books, etc...)

Usually it is some experience and google. You just have to learn what nodes usually do and how it corresponds with real-world properties and their combinations.


text:
Is there a way to separate colors from chained mix rgb nodes?
I am creating a node group that I would like to be able to make 6- 8 individual colors available for the material. While it would be ideal, I am aware that color ramps cannot be used from outside of a node group. As an alternative, I have tried chaining mixRGB nodes with the intent of separating the colors individualy. The problem I am having is that chaining mix rgb nodes seems to be unpredictable at times as to how exactly colors will mix/ separate.
The following image is to better illustrate my difficulty. The material settings in node shown are for the object displayed. The resulting mix is nothing like what is selected from the group. It seems that colors are ignored rather than combined or separated, and I don't know how to control this. I ultimately want to control a color per node in the 'math' node group within the material, which I think I can work out once I get this part sorted.

I have seen and tried working with this answer, but wasn't able to work with it when combining multiples of these groups together. I am also having a similar problem with the proposed answer. (Separating colors predictably)
Thus far, I have the material somewhat working but the colors blend somewhat unpredictably and seem to be a bit unreliable in how the material is affected. I haven't been able to find a good way to approach the problem. Below are the current node setups for the approaches I have been using.
This is my current node setup for my approach using mix rgb nodes:

What I would like to achieve, I have come close to using color ramps, but the problem there is that in order to make a change to color, I have to open the group, make the changes, and then continue.
This is the setup I used with color ramps:

This is the 'Math" node group within the material:

The general look I am after is as follows, the shader ball on the left is assigned the mix rgb setup, and the one on the right,which would be closer to the look I'd like the material to have is the color ramp setup:

Is what I am trying to do possible? If so, what is the correct way of doing this?
Here is the .blend file for anyone who would like to take a closer look and not copy a node setup from a screen shot:

Here is a way that can help :

I dont consider here the way you are using this kind of ramp, but I have just focused on a way to obtain the ramp. So I did not wanted here to reproduce the way you are using the shader (only the ramp).
This "pseudoRamp" node group is a thread of several "rampMix" nodes groups (this node group can be reused to have more or less colors as inputs) :

And the role of each of them is to give a color between two (the previous color and the tested color) depending if the value is in between the values margins.
Here is the "rampMix" :

And the "rampMix" itself uses a "between" node group :

This last "between" node group needs to handle the limits of "lesser than", as it is strict ("<" and not "<="). So we cannot use "lesser than" with a "greater than" or we will miss the limit value.
Here is the blend file
Note : this is not perfect at the limit, as you cannot downgrade the amount of colors (the last will stay last, but previous ones can overlap each other). So a little enhancement is needed for that.
Complement for the criss crossed aspect
The nodes described above can be mixed in order to make crossed color lines :
The first nodes on the left are here to modulate the amount of strips and are based only on the X, Y values in order to cross these axis only.

Thanks @lemon this is close, but I can't get it to separate color predictably this way either.

@Timaroberts I have difficulties to understand what you are looking for...  could you add some "hand drawings" pictures to help ?

this is not what you want ? https://i.gyazo.com/57e9631ef53f65f3c377b2c92ea26fea.png

Hi @lemon, the look was 'criss crossed' if you will.It's subtle, but you can see it above. I will try to edit again to be more clear about the color separation. Currently, I can't control where what color may go where on the material. That is the biggest problem, not knowing how they will separate.

Hi @Timaroberts, like this ? https://i.gyazo.com/d71f206e328f3638a1baa1b896e9e1a8.png


text:
How to automate this process (SVG to mesh > planar decimation > solidify > collapse decimation) to 300 files?
I just learned using blender. I set up my first milestone to finish my first task and I did with the help of tutorials and other questions on here. I tried using the record script but with no success whatsoever. I need to convert my svg files into a mesh first, then do a planar decimation with an angle limit 0.1. Then solidify to a thickness of 0.009 and finally do collapse decimation to a ratio of 0.1.
I found a script on here from this post How to loop through 100 files to do solidify through script? and tweaked it a little bit. I failed to make it apply for SVGs so I tested it with a couple of stl files and it works perfectly, unfortunately I need to add more to it and my editing is not working well.
When I run this script with just the planar decimation at an angle of 0.1 it does not give me the same outcome as done manually.
I tried using the info header to get a command for a rotation of -97 on the y-axis but it always fails, even when I run it alone; same for the smart UV unwrapping.
Thanks!!
import bpy
import glob
import os

def process(stl_fname):
    print('Processing %r' % stl_fname)

    # Determine output filename.
    out_fname = stl_fname.replace('.stl', '-solid.stl')
    if out_fname == stl_fname:
        raise ValueError('stl_fname should end in .stl')

    # Perform the processing.

    bpy.ops.object.modifier_add(type='DECIMATE')
    bpy.context.object.modifiers["Decimate"].decimate_type = 'DISSOLVE'
    bpy.context.object.modifiers["Decimate"].angle_limit = 0.00174533

    bpy.ops.import_mesh.stl(filepath=stl_fname)
    bpy.ops.object.modifier_add(type='SOLIDIFY')
    bpy.context.object.modifiers["Solidify"].thickness = 0.009

    bpy.ops.object.modifier_add(type='DECIMATE')
    bpy.context.object.modifiers["Decimate"].ratio = 0.1

    bpy.context.object.rotation_euler[1] = -1.69297

    bpy.ops.object.editmode_toggle()
    bpy.ops.uv.smart_project(angle_limit=89)

    print('Writing to %r' % out_fname)
    bpy.ops.export_mesh.stl(filepath=out_fname)
    bpy.ops.object.delete()

# Start with nothing in the scene
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()

# Process *.stl
here = bpy.path.abspath('//')
for stl_fname in glob.glob(os.path.join(here, '*.stl')):
    if '-solid.stl' in stl_fname:
        print('Skipping %r' % stl_fname)
        continue

    process(stl_fname)

Hi, you probably need to master somewhat python in blender to do what you wish. You "just" need to create a workflow for each SVG, and iterate on all your SVGs. Start showing here what happens when "failed and don't know what is happening"...

At least make sure that the code you post is actually syntactically correct, and follows PEP-8.

Can you attach/link to a few STL files so that we can try the same code on the same files?

This is pretty quick and dirty so be sure to test a small sample 1st, but i think it covers everything you asked for. Running the script will add a toolbar in the 3d view port, the values you had set in the example are properties you can change before importing and exporting all the files in the directories. Have fun with it.
import bpy
import os
from bpy.types import Operator
from bpy.types import Panel
from math import radians

bl_info = {
    "name": "AutoSVG",
    "author": "Your Name Here",
    "version": (1, 0),
    "blender": (2, 79, 0),
    "location": "View3D > Tools panel 'T' > AutoSVG > AutoSVG",
    "description": "",
    "warning": "",
    "wiki_url": "",
    "category": "",
    }

def makeprop():
    bpy.types.Scene.auto_svg_dir_in = bpy.props.StringProperty(
        name="bpy.types.Scene.auto_svg_dir_in",
        description="",
        default="",
        subtype="DIR_PATH",
        )
    bpy.types.Scene.auto_svg_decimate_angle = bpy.props.FloatProperty(
        name="bpy.types.Scene.auto_svg_decimate_angle",
        description="",
        default=radians(0.00174533),
        subtype="ANGLE",
        )
    bpy.types.Scene.auto_svg_thickness = bpy.props.FloatProperty(
        name="bpy.types.Scene.auto_svg_thickness",
        description="",
        default=0.009,
        subtype="DISTANCE",
        unit='LENGTH'
        )
    bpy.types.Scene.auto_svg_ratio = bpy.props.FloatProperty(
        name="bpy.types.Scene.auto_svg_ratio",
        description="",
        default=0.1,
        )
    bpy.types.Scene.auto_svg_rotation = bpy.props.FloatProperty(
        name="bpy.types.Scene.auto_svg_rotation",
        description="",
        default=radians(-1.69297),
        subtype="ANGLE",
        )
    bpy.types.Scene.auto_svg_uv_angle = bpy.props.FloatProperty(
        name="bpy.types.Scene.auto_svg_uv_angle",
        description="",
        default=radians(89),
        subtype="ANGLE",
        )
    bpy.types.Scene.auto_obj_dir_out = bpy.props.StringProperty(
        name="bpy.types.Scene.auto_obj_dir_out",
        description="",
        default="",
        subtype="DIR_PATH",
        )

def delprop():
    del bpy.types.Scene.auto_svg_dir_in
    del bpy.types.Scene.auto_svg_decimate_angle
    del bpy.types.Scene.auto_svg_thickness
    del bpy.types.Scene.auto_svg_ratio
    del bpy.types.Scene.auto_svg_rotation
    del bpy.types.Scene.auto_svg_uv_angle
    del bpy.types.Scene.auto_obj_dir_out

def begin(scene):
    for files in os.listdir(scene.auto_svg_dir_in):
        if not files.endswith(".svg"):
            print("unexpected file type : ", files)
            continue
        bpy.ops.import_curve.svg(
            filepath=str(os.path.join(scene.auto_svg_dir_in, files)))
        bpy.ops.object.select_all(action='DESELECT')
        my_svg = bpy.data.objects['Curve']
        my_svg.select = True
        scene.objects.active = my_svg
        my_svg.name = files.rstrip(".svg")
        bpy.ops.object.convert(target='MESH')
        bpy.ops.object.modifier_add(type='DECIMATE')
        bpy.context.object.modifiers["Decimate"].decimate_type = 'DISSOLVE'
        bpy.context.object.modifiers["Decimate"].angle_limit = (
            scene.auto_svg_decimate_angle)
        bpy.ops.object.modifier_add(type='SOLIDIFY')
        bpy.context.object.modifiers["Solidify"].thickness = (
            scene.auto_svg_thickness)
        bpy.ops.object.modifier_add(type='DECIMATE')
        bpy.context.object.modifiers["Decimate.001"].ratio = (
            scene.auto_svg_ratio)
        bpy.context.object.rotation_euler[1] = scene.auto_svg_rotation
        bpy.ops.object.editmode_toggle()
        bpy.ops.mesh.select_all(action='TOGGLE')
        bpy.ops.uv.smart_project(angle_limit=scene.auto_svg_uv_angle)
        bpy.ops.object.editmode_toggle()
        bpy.ops.export_scene.obj(
            filepath=str(os.path.join(
                scene.auto_obj_dir_out, files.replace(".svg", ".obj"))))
        bpy.ops.object.delete()

class Auto_SVG_Tool():
    @classmethod
    def main(cls, context):
        scene = bpy.context.scene
        print("start button pressed")
        filevalid = ((scene.auto_svg_dir_in is not "") and
                     (scene.auto_obj_dir_out is not ""))
        if not filevalid:
            print("invalid file location or name")
            return
        begin(scene)

class Auto_SVG_Button(bpy.types.Operator):
    """Execute generation"""
    bl_idname = "file.autosvg_operator"
    bl_label = "Generate"

    def execute(self, context):
        Auto_SVG_Tool.main(context)
        return {'FINISHED'}

class VIEW3D_PT_Blank1_Blank2(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "AutoSVG"
    bl_context = "objectmode"
    bl_label = "AutoSVG"

    def draw(self, context):
        scene = context.scene
        layout = self.layout
        row = layout.row()
        col = layout.column(align=True)
        col.prop(scene, "auto_svg_dir_in", "Input Dir")
        col.separator()
        col.prop(scene, "auto_svg_decimate_angle", "Decimate angle")
        col.prop(scene, "auto_svg_thickness", "Solidify Thickness")
        col.prop(scene, "auto_svg_ratio", "Decimate Ratio")
        col.prop(scene, "auto_svg_rotation", "Object rotation")
        col.prop(scene, "auto_svg_uv_angle", "UV project angle lim")
        col.separator()
        col.prop(scene, "auto_obj_dir_out", "Output Dir")
        col.separator()
        col.operator("file.autosvg_operator", text="Start Files")

def register():
    print("registered")
    bpy.utils.register_class(VIEW3D_PT_Blank1_Blank2)
    bpy.utils.register_class(Auto_SVG_Button)
    makeprop()

def unregister():
    print("un-registered")
    bpy.utils.unregister_class(VIEW3D_PT_Blank1_Blank2)
    bpy.utils.unregister_class(Auto_SVG_Button)
    delprop()

if __name__ == "__main__":
    register()

changes include:
PEP8 compliance check via http://pep8online.com.
Removed several unused options in properties per batFINGER recommendations.
Invert logic in if statements per Dr. Sybren recommendation reducing indents.
Exported to .obj instead of .stl to preserve UV's.
Due to handling of bpy.ops.export_scene.obj() removed debug print commands.
Renamed curves based on imported file name.

Remember blender uses radians for angles. (1 radian =  180 / pi degrees). Most readable  method (IMO) is from math import radians ,  default = radians(89)  Can I suggest too, you can leave out defaults, (eg get=None)  in property definitions, and good to use unit = 'ANGLE' for angles, and possibly unit = 'LENGTH' for thickness.

@batFINGER thanks for the input, still learning and being self taught I have to say my teacher sucks ;). As for the properties I am currently just using a script to generate them in a fairly bland way to save typing, but like to keep some of the mostly unused options shown in the event i need them. I'm sure a lot of folks could do a cleaner job on the code, and maybe one day I will be able to as well, for now just trying to help if & when I can.

Another few ways to imrpove the script are to stick to PEP-8 (so don't use capitals in property names), and to flip some conditions. Instead of doing if good: do stuff; else: print message, do if bad: print message and continue/return. That way your code gets indented less and more readable. See https://www.youtube.com/watch?v=mYrPqrFY7mA&t=3207 for more context.

Thank you so much @Ratt and dr. Sybren, I really appreciate it. The script runs well, but the planar decimation is not giving the same outcome as done manually and the smart uv project doesn't work at all.

@AGIMZ When exactly are you converting from curve to mesh when you do this manually. Before, after or in the middle of the modifiers being added?

@Ratt The UV project is still not working after I added the command. Links for the planar decimation https://we.tl/p3XtwwHnEA

@Ratt  I convert from curve to mesh before all modifiers are added.

@AGIMZ Apparently the .stl file format does not preserve UV's. So I've altered the script to export as obj. Each export will include a .obj & .mtl file both named based on the original file name.


text:
Is there any decent way to bulk change a material Parameter?
I'm have imported a model of AnorLondo from Darksouls to Use as a lighting study. I have run into the problem of all the materials having a value of 1 for specularity. I have tried using the copy to selected and holding Alt while moving the slider. There are 63 different materials, all of which I would like to change the specularity value. I feel brute forcing it would do the trick, but would be very time consuming. Is there any quick/easy way to achieve this?

You can go to Scripting workspace (tab), paste this code to Python console (and press ↩ Enter twice) or to a new text block (and run it with ▶ Play button):
from bpy import data as D
for mat in D.materials:
    if not mat.use_nodes: continue
    for node in mat.node_tree.nodes:
        for inp in node.inputs:
            if inp.name == 'Specular':
                inp.default_value = 0.5

Notice the new value is at the very end, in general you should set specularity to $0.5$ for physically correct renders.