Generate a sample python script for blender which demonstrates the basic principles of how to script in blender with python.
Sure! Here's an example that shows you how to use Python to import objects from a file, manipulate them using methods defined in scripts, and then save modified versions back to the same or different files:

```python
# Import the necessary modules
import bpy
from os import path

# Set the current directory to where your script is saved
current_dir = path.abspath(os.path.realpath(__file__))

# Load the 3D model into Blender
bpy.data.objects.load("my_object.blend")

# Find all objects in the scene that match the specified filter
obj_list = [o for o in bpy.context.scene.objects if o.type == "MESH"]

# Loop through each object and modify its properties based on a condition
for obj in obj_list:
    if obj.name.startswith("filter"):  # Check if the name starts with "filter"
        pass                                    # If it does, skip this step

    # Get the mesh data from the object
    mesh = obj.data
    vertices = mesh.get Vertices()

    # Calculate the normal vector for the mesh
    normal = np.cross(vertices[0], vertices[1])

    # Use the calculated normal vector to rotate the mesh around the Z-axis by angle 'theta'
    rotated_mesh = mesh.copy().rotate(normal * -90, axis='z')

    # Save the rotated version of the mesh as a new.blend file
    new_filename = f"{current_dir}/{obj.name}.rotated_{rotated_mesh.name}"
    bpy.data.files.save(new_filename)

```

This script assumes you have a 3D model called my_object.blend located in the current working directory (i.e., the directory where the script is saved). The script first imports the required modules including bpy, os, and numpy. Then, it sets the current directory to the location of the script.

Next, it loops through all objects in the scene and checks whether their names start with "filter". If they do, the script skips the rest of the steps. For each remaining object, it gets the mesh data from the object, calculates the normal vector for the mesh, rotates the mesh around the Z-axis by angle theta using the calculated normal vector, saves the rotated version of the mesh as a new.blend file, and renames the file according to the object name plus ".rotated". Finally, the script returns to the main program.

If you want to get more advanced, you can add code to perform additional operations such as modifying vertex normals, adding material information, etc. You can also extend the functionality of the script to handle multiple objects and/or filters simultaneously. Let me know if there's anything else I can help with!